@ Override public void visitCode ( Code obj ) { try { possibleParmRegs . clear ( ) ; Method m = getMethod ( ) ; String methodSignature = m . getSignature ( ) ; String retSignature = SignatureUtils . getReturnSignature ( methodSignature ) ; JavaClass returnClass = null ; int [ ] parmRegs = null ; if ( retSignature . startsWith ( Values . SIG_QUALIFIED_CLASS_PREFIX ) && ! knownImmutables . contains ( retSignature ) ) { List < String > parmTypes = SignatureUtils . getParameterSignatures ( methodSignature ) ; for ( int p = 0 ; p < parmTypes . size ( ) ; p ++ ) { String parmSignature = parmTypes . get ( p ) ; if ( parmSignature . startsWith ( Values . SIG_QUALIFIED_CLASS_PREFIX ) && ! knownImmutables . contains ( parmSignature ) ) { if ( returnClass == null ) { returnClass = Repository . lookupClass ( SignatureUtils . trimSignature ( retSignature ) ) ; parmRegs = RegisterUtils . getParameterRegisters ( m ) ; } if ( parmRegs != null ) { JavaClass parmClass = Repository . lookupClass ( SignatureUtils . stripSignature ( parmSignature ) ) ; if ( parmClass . instanceOf ( returnClass ) ) { possibleParmRegs . put ( Integer . valueOf ( parmRegs [ p ] ) , new ParmUsage ( ) ) ; } } } } if ( ! possibleParmRegs . isEmpty ( ) ) { try { stack . resetForMethodEntry ( this ) ; super . visitCode ( obj ) ; for ( ParmUsage pu : possibleParmRegs . values ( ) ) { if ( ( pu . returnPC >= 0 ) && ( pu . alteredPC >= 0 ) && ( pu . returnPC > pu . alteredPC ) ) { bugReporter . reportBug ( new BugInstance ( this , BugType . CFS_CONFUSING_FUNCTION_SEMANTICS . name ( ) , NORMAL_PRIORITY ) . addClass ( this ) . addMethod ( this ) . addSourceLine ( this , pu . returnPC ) . addSourceLine ( this , pu . alteredPC ) ) ; } } } catch ( StopOpcodeParsingException e ) { // no parm regs left } } } } catch ( ClassNotFoundException cnfe ) { bugReporter . reportMissingClass ( cnfe ) ; } }
implements the visitor to look for any non - immutable typed parameters are assignable to the return type . If found the method is parsed .