@ Override public void sawOpcode ( int seen ) { if ( ( seen == Const . INVOKEINTERFACE ) || ( seen == Const . INVOKEVIRTUAL ) || ( seen == Const . INVOKESPECIAL ) || ( seen == Const . INVOKESTATIC ) ) { String clsName = getClassConstantOperand ( ) ; String mName = getNameConstantOperand ( ) ; String methodInfo = clsName + ' ' + mName ; String thisMethodInfo = ( clsName . equals ( getClassName ( ) ) ) ? ( mName + ' ' + methodSig ) : "0" ; if ( expensiveCalls . contains ( methodInfo ) || expensiveThisCalls . contains ( thisMethodInfo ) ) { if ( isListenerMethod ) { bugReporter . reportBug ( new BugInstance ( this , BugType . SG_SLUGGISH_GUI . name ( ) , NORMAL_PRIORITY ) . addClass ( this ) . addMethod ( this . getClassContext ( ) . getJavaClass ( ) , listenerCode . get ( this . getCode ( ) ) ) ) ; } else { expensiveThisCalls . add ( getMethodName ( ) + ' ' + getMethodSig ( ) ) ; } throw new StopOpcodeParsingException ( ) ; } } }
overrides the visitor to look for the execution of expensive calls