private void sawMethodOpcode ( int seen ) { boolean isSyncCollection = false ; try { stack . mergeJumps ( this ) ; isSyncCollection = isSyncCollectionCreation ( seen ) ; switch ( seen ) { case Const . INVOKEVIRTUAL : case Const . INVOKEINTERFACE : String methodName = getNameConstantOperand ( ) ; if ( modifyingMethods . contains ( methodName ) ) { String signature = getSigConstantOperand ( ) ; int parmCount = SignatureUtils . getNumParameters ( signature ) ; if ( stack . getStackDepth ( ) > parmCount ) { OpcodeStack . Item item = stack . getStackItem ( parmCount ) ; XField field = item . getXField ( ) ; if ( field != null ) { collectionFields . remove ( field . getName ( ) ) ; } else { int reg = item . getRegisterNumber ( ) ; if ( reg >= 0 ) { Integer register = Integer . valueOf ( reg ) ; String fName = aliases . get ( register ) ; if ( fName != null ) { collectionFields . remove ( fName ) ; aliases . remove ( register ) ; } } } } } removeCollectionParameters ( ) ; break ; case Const . INVOKESTATIC : removeCollectionParameters ( ) ; break ; case Const . ARETURN : if ( stack . getStackDepth ( ) > 0 ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; XField field = item . getXField ( ) ; if ( field != null ) { collectionFields . remove ( field . getName ( ) ) ; } } break ; case Const . PUTFIELD : case Const . PUTSTATIC : String fieldName = getNameConstantOperand ( ) ; collectionFields . remove ( fieldName ) ; break ; case Const . GOTO : case Const . GOTO_W : if ( stack . getStackDepth ( ) > 0 ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; XField field = item . getXField ( ) ; if ( field != null ) { collectionFields . remove ( field . getName ( ) ) ; } } break ; default : break ; } } finally { TernaryPatcher . pre ( stack , seen ) ; stack . sawOpcode ( this , seen ) ; TernaryPatcher . post ( stack , seen ) ; if ( isSyncCollection && ( stack . getStackDepth ( ) > 0 ) ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; item . setUserValue ( Boolean . TRUE ) ; } } }
handles regular methods by looking for methods on collections that are modifying and removes those collections from the ones under review