private void reportBugs ( ) { Iterator < Map . Entry < Integer , Map < JavaClass , List < MethodInfo > > > > it = parameterDefiners . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { try { Map . Entry < Integer , Map < JavaClass , List < MethodInfo > > > entry = it . next ( ) ; Integer reg = entry . getKey ( ) ; if ( ! usedParameters . get ( reg . intValue ( ) ) ) { it . remove ( ) ; continue ; } Map < JavaClass , List < MethodInfo > > definers = entry . getValue ( ) ; definers . remove ( objectClass ) ; if ( definers . size ( ) > 1 ) { removeInheritedInterfaces ( definers ) ; } if ( ( definers . size ( ) == 1 ) && ! hasOverloadedMethod ( ) ) { String name = "" ; LocalVariableTable lvt = getMethod ( ) . getLocalVariableTable ( ) ; if ( lvt != null ) { LocalVariable lv = lvt . getLocalVariable ( reg . intValue ( ) , 0 ) ; if ( lv != null ) { name = lv . getName ( ) ; } } int parm = reg . intValue ( ) ; if ( ! methodIsStatic ) { parm -- ; } parm ++ ; // users expect 1 based parameters String infName = definers . keySet ( ) . iterator ( ) . next ( ) . getClassName ( ) ; bugReporter . reportBug ( new BugInstance ( this , BugType . OCP_OVERLY_CONCRETE_PARAMETER . name ( ) , NORMAL_PRIORITY ) . addClass ( this ) . addMethod ( this ) . addSourceLine ( this , 0 ) . addString ( getCardinality ( parm ) + " parameter '" + name + "' could be declared as " + infName + " instead" ) ) ; } } catch ( ClassNotFoundException e ) { bugReporter . reportMissingClass ( e ) ; } } }
implements the post processing steps to report the remaining unremoved parameter definers ie those that can be defined more abstractly .