Skip to content

IllegalArgumentException below FindNoSideEffectMethods.getMethodCall() #3320

@iloveeclipse

Description

@iloveeclipse

Running latest SpotBugs Eclipse nightly build 4.9.2.202502140028-6b58d85. No small reproducer yet, except to load this project in Eclipse https://github.com/eclipse-pde/eclipse.pde/tree/master/ui/org.eclipse.pde.ui and run SpotBugs on it.

The org.eclipse.pde.ui project has dependency to biz.aQute.bndlib library where SpotBugs seem to have trouble analyzing aQute.lib.converter.Converter.newInstance method call.

eclipse.buildId=4.35.0.I20250213-1800
java.version=21.0.6-7
java.vendor=N/A
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64 -data /data/4x_platform_workspace

com.github.spotbugs.plugin.eclipse
Error
Fri Feb 14 07:24:26 CET 2025
Can't get stack offset 1 from [< Ljava/lang/invoke/MethodHandle;, return value from java.lang.invoke.MethodHandles$Lookup.findConstructor(Ljava/lang/Class;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle; >] @ 10 in aQute.lib.converter.Converter.newInstance : (Ljava.lang.Class;)Ljava.lang.Object;

java.lang.IllegalArgumentException: 1 is not a value stack offset
	at edu.umd.cs.findbugs.OpcodeStack.getStackItem(OpcodeStack.java:3280)
	at edu.umd.cs.findbugs.detect.FindNoSideEffectMethods.getMethodCall(FindNoSideEffectMethods.java:587)
	at edu.umd.cs.findbugs.detect.FindNoSideEffectMethods.sawOpcode(FindNoSideEffectMethods.java:577)
	at edu.umd.cs.findbugs.visitclass.DismantleBytecode.visit(DismantleBytecode.java:884)
	at edu.umd.cs.findbugs.detect.FindNoSideEffectMethods.visit(FindNoSideEffectMethods.java:485)
	at edu.umd.cs.findbugs.visitclass.BetterVisitor.visitCode(BetterVisitor.java:218)
	at edu.umd.cs.findbugs.visitclass.PreorderVisitor.visitCode(PreorderVisitor.java:251)
	at edu.umd.cs.findbugs.bcel.OpcodeStackDetector.visitCode(OpcodeStackDetector.java:65)
	at org.apache.bcel.classfile.Code.accept(Code.java:145)
	at edu.umd.cs.findbugs.visitclass.PreorderVisitor.doVisitMethod(PreorderVisitor.java:323)
	at edu.umd.cs.findbugs.visitclass.PreorderVisitor.visitJavaClass(PreorderVisitor.java:405)
	at org.apache.bcel.classfile.JavaClass.accept(JavaClass.java:249)
	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:1100)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	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:1110)
	at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:309)
	at de.tobject.findbugs.builder.FindBugsWorker.runFindBugs(FindBugsWorker.java:314)
	at de.tobject.findbugs.builder.FindBugsWorker.work(FindBugsWorker.java:220)
	at de.tobject.findbugs.actions.FindBugsAction$StartedFromViewJob.runWithProgress(FindBugsAction.java:274)
	at de.tobject.findbugs.FindBugsJob.run(FindBugsJob.java:141)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions