@ Override public void sawOpcode ( int seen ) { String methodPackage = null ; try { stack . precomputation ( this ) ; if ( seen == Const . INVOKEVIRTUAL ) { methodPackage = processInvokeVirtual ( ) ; } else if ( OpcodeUtils . isAStore ( seen ) ) { if ( stack . getStackDepth ( ) > 0 ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; Integer reg = Integer . valueOf ( RegisterUtils . getAStoreReg ( this , seen ) ) ; if ( item . getUserValue ( ) != null ) { XMethod xm = item . getReturnValueOf ( ) ; if ( xm != null ) { toStringRegisters . put ( reg , xm . getPackageName ( ) ) ; } else { toStringRegisters . remove ( reg ) ; } } else { toStringRegisters . remove ( reg ) ; } } } else if ( OpcodeUtils . isALoad ( seen ) ) { Integer reg = Integer . valueOf ( RegisterUtils . getAStoreReg ( this , seen ) ) ; methodPackage = toStringRegisters . get ( reg ) ; } } catch ( ClassNotFoundException cnfe ) { bugReporter . reportMissingClass ( cnfe ) ; } finally { TernaryPatcher . pre ( stack , seen ) ; stack . sawOpcode ( this , seen ) ; TernaryPatcher . post ( stack , seen ) ; if ( ( methodPackage != null ) && ( stack . getStackDepth ( ) > 0 ) ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; item . setUserValue ( methodPackage ) ; } } }
overrides the visitor to look for suspicious operations on toString