question: public void logDiff ( String id , String field , String db , String hw ) { StringBuffer diffBuffer = new StringBuffer ( String . format ( "Controller database object ID [%s], field [%s]: " , id , field ) ) ; if ( db == null || db . isEmpty ( ) || db . equalsIgnoreCase ( NO_MATCHING_ENTRY ) ) { diffBuffer . append ( String . format ( "The hardware reported entry [%s], whereas the controller is not managing or does not have a reference to the same resource\n" , hw ) ) ; } else if ( hw == null || hw . isEmpty ( ) || hw . equalsIgnoreCase ( NO_MATCHING_ENTRY ) ) { diffBuffer . append ( String . format ( "The controller is managing resource [%s], whereas the hardware did not report that resource\n" , db ) ) ; } else { diffBuffer . append ( String . format ( "The controller references resource: [%s], whereas the hardware reported the actual resource as: [%s]\n" , db != null ? db : "null" , hw != null ? hw : "null" ) ) ; } msgs . append ( diffBuffer . toString ( ) + "\n" ) ; if ( log != null ) { log . info ( diffBuffer . toString ( ) ) ; } }
target:  Log a discrepancy in the data.