You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the trivially wrong test code below (derived from a more complex text case where some code was per mistake added after fail()), spotbugs 4.8.0 reports an execution error.
package xxx;
public class Regression {
public void testUnreachableCode() {
org.junit.Assert.fail();
System.err.println("Not reachable code");
}
}
Error reported:
java.lang.IllegalArgumentException: 0 is not a value stack offset
at edu.umd.cs.findbugs.OpcodeStack.getStackItem(OpcodeStack.java:3277)
at edu.umd.cs.findbugs.detect.DumbMethods$NullMethodsSubDetector.sawOpcode(DumbMethods.java:175)
at edu.umd.cs.findbugs.detect.DumbMethods.sawOpcode(DumbMethods.java:916)
at edu.umd.cs.findbugs.visitclass.DismantleBytecode.visit(DismantleBytecode.java:878)
at edu.umd.cs.findbugs.detect.DumbMethods.visit(DumbMethods.java:1565)
at edu.umd.cs.findbugs.visitclass.BetterVisitor.visitCode(BetterVisitor.java:218)
at edu.umd.cs.findbugs.visitclass.PreorderVisitor.visitCode(PreorderVisitor.java:250)
at edu.umd.cs.findbugs.bcel.OpcodeStackDetector.visitCode(OpcodeStackDetector.java:65)
at org.apache.bcel.classfile.Code.accept(Code.java:121)
at edu.umd.cs.findbugs.visitclass.PreorderVisitor.doVisitMethod(PreorderVisitor.java:322)
at edu.umd.cs.findbugs.visitclass.PreorderVisitor.visitJavaClass(PreorderVisitor.java:404)
at org.apache.bcel.classfile.JavaClass.accept(JavaClass.java:244)
at edu.umd.cs.findbugs.BytecodeScanningDetector.visitClassContext(BytecodeScanningDetector.java:38)
at edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:76)
at edu.umd.cs.findbugs.FindBugs2.lambda$analyzeApplication$1(FindBugs2.java:1108)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at edu.umd.cs.findbugs.CurrentThreadExecutorService.execute(CurrentThreadExecutorService.java:86)
at java.base/java.util.concurrent.AbstractExecutorService.invokeAll(AbstractExecutorService.java:247)
at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1118)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:309)
The text was updated successfully, but these errors were encountered:
For the trivially wrong test code below (derived from a more complex text case where some code was per mistake added after
fail()
), spotbugs 4.8.0 reports an execution error.Error reported:
The text was updated successfully, but these errors were encountered: