for (int i : clauses) bug.addSourceLineRange(this.classContext, this, switchPos[i], switchPos[i + 1] - 1); // not
.addSourceLineRange(classContext, this, thenStartPos, thenFinishPos) .addSourceLineRange(classContext, this, elseStartPos, elseFinishPos));
if (declaration == null || !declaration.isVolatile()) { bugReporter.reportBug(new BugInstance(this, "DC_DOUBLECHECK", NORMAL_PRIORITY).addClassAndMethod(this) .addField(f).describe("FIELD_ON").addSourceLineRange(this, startPC, endPC)); } else { if(declaration.isReferenceType()) {
.addClassAndMethod(this).addString("Unreachable loop body").addSourceLineRange(this, becameTop, getPC());
.addSourceLineRange(this, syncPC + 1, pc));
.addSourceLineRange(this, syncPC + 1, pc));
.addSourceLineRange(this, 0, obj.getCode().length - 1).addString(bestEnvy));
.addSourceLineRange(this, 0, obj.getCode().length - 1).addString(bestEnvy));
&& firstBlock.getExceptionSignature().equals(secondBlock.getExceptionSignature())) { bugReporter.reportBug(new BugInstance(this, BugType.STB_STACKED_TRY_BLOCKS.name(), NORMAL_PRIORITY).addClass(this) .addMethod(this).addSourceLineRange(this, firstBlock.getStartPC(), firstBlock.getEndHandlerPC()) .addSourceLineRange(this, secondBlock.getStartPC(), secondBlock.getEndHandlerPC()));
&& firstBlock.getExceptionSignature().equals(secondBlock.getExceptionSignature())) { bugReporter.reportBug(new BugInstance(this, BugType.STB_STACKED_TRY_BLOCKS.name(), NORMAL_PRIORITY).addClass(this) .addMethod(this).addSourceLineRange(this, firstBlock.getStartPC(), firstBlock.getEndHandlerPC()) .addSourceLineRange(this, secondBlock.getStartPC(), secondBlock.getEndHandlerPC()));
for (int i : clauses) bug.addSourceLineRange(this.classContext, this, switchPos[i], switchPos[i + 1] - 1); // not
.addSourceLineRange(classContext, this, thenStartPos, thenFinishPos) .addSourceLineRange(classContext, this, elseStartPos, elseFinishPos));
if ((getPC() == fl.getLoopEnd()) && (fl.getLoopState() == LoopState.LOOP_IN_BODY_WITH_GET)) { bugReporter.reportBug(new BugInstance(this, "LII_LIST_INDEXED_ITERATING", NORMAL_PRIORITY).addClass(this).addMethod(this) .addSourceLineRange(this, fl.getLoopStart(), fl.getLoopEnd())); it.remove();
/** * overrides the visitor to find abstract methods that override concrete * ones * * @param obj * the context object of the currently parsed method */ @Override public void visitMethod(Method obj) { if (!obj.isAbstract()) return; String methodName = obj.getName(); String methodSig = obj.getSignature(); outer: for (JavaClass cls : superClasses) { Method[] methods = cls.getMethods(); for (Method m : methods) { if (m.isPrivate() || m.isAbstract()) continue; if (methodName.equals(m.getName()) && methodSig.equals(m.getSignature())) { BugInstance bug = new BugInstance(this, BugType.AOM_ABSTRACT_OVERRIDDEN_METHOD.name(), NORMAL_PRIORITY).addClass(this).addMethod(this); Code code = obj.getCode(); if (code != null) bug.addSourceLineRange(clsContext, this, 0, code.getLength() - 1); bugReporter.reportBug(bug); break outer; } } } }
/** * overrides the visitor to find abstract methods that override concrete ones * * @param obj * the context object of the currently parsed method */ @Override public void visitMethod(Method obj) { if (!obj.isAbstract()) return; String methodName = obj.getName(); String methodSig = obj.getSignature(); outer: for (JavaClass cls : superClasses) { Method[] methods = cls.getMethods(); for (Method m : methods) { if (m.isPrivate() || m.isAbstract()) continue; if (methodName.equals(m.getName()) && methodSig.equals(m.getSignature())) { BugInstance bug = new BugInstance(this, BugType.AOM_ABSTRACT_OVERRIDDEN_METHOD.name(), NORMAL_PRIORITY).addClass(this).addMethod(this); Code code = obj.getCode(); if (code != null) bug.addSourceLineRange(clsContext, this, 0, code.getLength() - 1); bugReporter.reportBug(bug); break outer; } } } }
if (declaration == null || !declaration.isVolatile()) { bugReporter.reportBug(new BugInstance(this, "DC_DOUBLECHECK", NORMAL_PRIORITY).addClassAndMethod(this) .addField(f).describe("FIELD_ON").addSourceLineRange(this, startPC, endPC)); } else { if(declaration.isReferenceType()) {
if ((getPC() == fl.getLoopEnd()) && (fl.getLoopState() == LoopState.LOOP_IN_BODY_WITH_GET)) { bugReporter.reportBug(new BugInstance(this, "LII_LIST_INDEXED_ITERATING", NORMAL_PRIORITY).addClass(this).addMethod(this) .addSourceLineRange(this, fl.getLoopStart(), fl.getLoopEnd())); it.remove();
bugReporter .reportBug(new BugInstance(this, BugType.BL_BURYING_LOGIC.name(), ratio > normalBugRatioLimit ? NORMAL_PRIORITY : LOW_PRIORITY) .addClass(this).addMethod(this).addSourceLineRange(this, activeUnconditional.getStart(), activeUnconditional.getEnd())); throw new StopOpcodeParsingException();
bugReporter .reportBug(new BugInstance(this, BugType.BL_BURYING_LOGIC.name(), ratio > normalBugRatioLimit ? NORMAL_PRIORITY : LOW_PRIORITY) .addClass(this).addMethod(this).addSourceLineRange(this, activeUnconditional.getStart(), activeUnconditional.getEnd())); throw new StopOpcodeParsingException();
.addClassAndMethod(this).addString("Unreachable loop body").addSourceLineRange(this, becameTop, getPC());