@ Override public void sawOpcode ( int seen ) { int pc = 0 ; try { stack . precomputation ( this ) ; switch ( state ) { case SAW_NOTHING : pc = sawOpcodeAfterNothing ( seen ) ; break ; case SAW_CTOR : if ( ( seen == Const . POP ) || ( seen == Const . RETURN ) ) { bugReporter . reportBug ( new BugInstance ( this , BugType . SEC_SIDE_EFFECT_CONSTRUCTOR . name ( ) , NORMAL_PRIORITY ) . addClass ( this ) . addMethod ( this ) . addSourceLine ( this ) ) ; } state = State . SAW_NOTHING ; break ; } } finally { TernaryPatcher . pre ( stack , seen ) ; stack . sawOpcode ( this , seen ) ; TernaryPatcher . post ( stack , seen ) ; if ( ( pc != 0 ) && ( stack . getStackDepth ( ) > 0 ) ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; item . setUserValue ( Integer . valueOf ( pc ) ) ; } } }
overrides the visitor to look for constructors who s value is popped off the stack and not assigned before the pop of the value or if a return is issued with that object still on the stack .