@ Override public void sawOpcode ( int seen ) { try { stack . precomputation ( this ) ; switch ( seen ) { case Const . IRETURN : { processIntegerReturn ( ) ; } break ; case Const . GOTO : case Const . GOTO_W : { if ( stack . getStackDepth ( ) > 0 ) { throw new StopOpcodeParsingException ( ) ; } if ( furthestBranchTarget < getBranchTarget ( ) ) { furthestBranchTarget = getBranchTarget ( ) ; } } break ; case Const . IFEQ : case Const . IFNE : case Const . IFLT : case Const . IFGE : case Const . IFGT : case Const . IFLE : case Const . IF_ICMPEQ : case Const . IF_ICMPNE : case Const . IF_ICMPLT : case Const . IF_ICMPGE : case Const . IF_ICMPGT : case Const . IF_ICMPLE : case Const . IF_ACMPEQ : case Const . IF_ACMPNE : case Const . IFNULL : case Const . IFNONNULL : { if ( furthestBranchTarget < getBranchTarget ( ) ) { furthestBranchTarget = getBranchTarget ( ) ; } } break ; case Const . LOOKUPSWITCH : case Const . TABLESWITCH : { int defTarget = getDefaultSwitchOffset ( ) + getPC ( ) ; if ( furthestBranchTarget > defTarget ) { furthestBranchTarget = defTarget ; } } break ; case Const . ATHROW : { if ( stack . getStackDepth ( ) > 0 ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; String exSig = item . getSignature ( ) ; if ( "Ljava/lang/UnsupportedOperationException;" . equals ( exSig ) ) { throw new StopOpcodeParsingException ( ) ; } } } break ; /* * these three opcodes are here because findbugs proper is broken, it sometimes * doesn't push this constant on the stack, because of bad branch handling */ case Const . ICONST_0 : if ( getNextOpcode ( ) == Const . IRETURN ) { sawConstant = Integer . valueOf ( 0 ) ; } break ; case Const . ICONST_M1 : if ( getNextOpcode ( ) == Const . IRETURN ) { sawConstant = Integer . valueOf ( - 1 ) ; } break ; case Const . ICONST_1 : if ( getNextOpcode ( ) == Const . IRETURN ) { sawConstant = Integer . valueOf ( 1 ) ; } break ; default : break ; } } finally { stack . sawOpcode ( this , seen ) ; } }
implements the visitor to look for returns of constant values and records them for being negative zero or positive . It also records unconditional returns of non zero values