@ Override public void sawOpcode ( int seen ) { boolean reset = true ; switch ( state ) { // TODO: Refactor this to use state pattern, not nested // switches case SEEN_NOTHING : reset = sawOpcodeAfterNothing ( seen ) ; break ; case SEEN_ALOAD : reset = sawOpcodeAfterLoad ( seen ) ; break ; case SEEN_GETFIELD : reset = sawOpcodeAfterGetField ( seen ) ; break ; case SEEN_DUAL_LOADS : reset = sawOpcodeAfterDualLoads ( seen ) ; break ; case SEEN_INVOKEVIRTUAL : if ( seen == Const . INVOKEVIRTUAL ) { checkForSGSU ( ) ; } break ; } if ( reset ) { beanReference1 = null ; beanReference2 = null ; propType = null ; propName = null ; sawField = false ; state = State . SEEN_NOTHING ; } }
overrides the visitor to look for a setXXX with the value returned from a getXXX using the same base object .