@Override public void sawOpcode(int seen) { if (seen == Const.LDC || seen == Const.LDC_W || seen == Const.LDC2_W) { Constant c = getConstantRefOperand(); if (c instanceof ConstantFloat) { checkConst(((ConstantFloat) c).getBytes()); } else if (c instanceof ConstantDouble) { checkConst(((ConstantDouble) c).getBytes()); } return; } // Lower priority if the constant is put into array immediately or after the boxing: // this is likely to be just similar number in some predefined dataset (like lookup table) if(seen == Const.INVOKESTATIC && lastBug != null) { if (getNextOpcode() == Const.AASTORE && getNameConstantOperand().equals("valueOf") && (getClassConstantOperand().equals("java/lang/Double") || getClassConstantOperand().equals( "java/lang/Float"))) { lastBug = ((BugInstance)lastBug.clone()); lastBug.setPriority(lastPriority+1); bugAccumulator.forgetLastBug(); bugAccumulator.accumulateBug(lastBug, this); } } lastBug = null; }
@Override public void sawOpcode(int seen) { if (seen == LDC || seen == LDC_W || seen == LDC2_W) { Constant c = getConstantRefOperand(); if (c instanceof ConstantFloat) { checkConst(((ConstantFloat) c).getBytes()); } else if (c instanceof ConstantDouble) { checkConst(((ConstantDouble) c).getBytes()); } return; } // Lower priority if the constant is put into array immediately or after the boxing: // this is likely to be just similar number in some predefined dataset (like lookup table) if(seen == INVOKESTATIC && lastBug != null) { if (getNextOpcode() == AASTORE && getNameConstantOperand().equals("valueOf") && (getClassConstantOperand().equals("java/lang/Double") || getClassConstantOperand().equals( "java/lang/Float"))) { lastBug = ((BugInstance)lastBug.clone()); lastBug.setPriority(lastPriority+1); bugAccumulator.forgetLastBug(); bugAccumulator.accumulateBug(lastBug, this); } } lastBug = null; }