private boolean isInteresting(Number constValue, double candidate) { for (BadConstant badConstant : badConstants) { if(getPriority(badConstant, constValue, candidate) < IGNORE_PRIORITY) { return true; } } return false; }
private void checkConst(Number constValue) { double candidate = constValue.doubleValue(); if (Double.isNaN(candidate) || Double.isInfinite(candidate)) { return; } for (BadConstant badConstant : badConstants) { int priority = getPriority(badConstant, constValue, candidate); if(getNextOpcode() == Const.FASTORE || getNextOpcode() == Const.DASTORE) { priority++; } if(priority < IGNORE_PRIORITY) { lastPriority = priority; lastBug = new BugInstance(this, "CNT_ROUGH_CONSTANT_VALUE", priority).addClassAndMethod(this) .addString(constValue.toString()).addString(badConstant.replacement); bugAccumulator.accumulateBug(lastBug, this); return; } } } }
private boolean isInteresting(Number constValue, double candidate) { for (BadConstant badConstant : badConstants) { if(getPriority(badConstant, constValue, candidate) < IGNORE_PRIORITY) { return true; } } return false; }
private void checkConst(Number constValue) { double candidate = constValue.doubleValue(); if (Double.isNaN(candidate) || Double.isInfinite(candidate)) { return; } for (BadConstant badConstant : badConstants) { int priority = getPriority(badConstant, constValue, candidate); if(getNextOpcode() == FASTORE || getNextOpcode() == DASTORE) { priority++; } if(priority < IGNORE_PRIORITY) { lastPriority = priority; lastBug = new BugInstance(this, "CNT_ROUGH_CONSTANT_VALUE", priority).addClassAndMethod(this) .addString(constValue.toString()).addString(badConstant.replacement); bugAccumulator.accumulateBug(lastBug, this); return; } } } }