private int getIntProperty ( String key , boolean defaultProvided , int defaultValue , StringBuilder errors ) { String value = getStringProperty ( key ) ; if ( null != value ) { try { int realValue = Integer . parseInt ( value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Property " + key + " set to " + realValue ) ; } return realValue ; } catch ( NumberFormatException nfe ) { // no FFDC required; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Property " + key + ", format error in [" + value + "]" ) ; } } } if ( ! defaultProvided ) { // No default available. This is an error. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Property " + key + " not found. Error being tallied." ) ; } errors . append ( key ) ; errors . append ( ":null \n" ) ; return - 1 ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Property " + key + " using default " + defaultValue ) ; } return defaultValue ; }
Extract an integer property from the stored values . This might use a default value if provided and the property was not found .