Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException during analysis #180

Open
Bananeweizen opened this issue Feb 8, 2019 · 1 comment
Open

IllegalArgumentException during analysis #180

Bananeweizen opened this issue Feb 8, 2019 · 1 comment
Assignees

Comments

@Bananeweizen
Copy link

When adding this as plugin to spotbugs, I see one new exception in our build logs.

[INFO] --- maven-site-plugin:3.7.1:site (default-site) @ com.etas.ascet.ui.views ---
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:3.0.0
[INFO] configuring report plugin com.github.spotbugs:spotbugs-maven-plugin:3.1.11
[INFO] 1 report detected for spotbugs-maven-plugin:3.1.11: spotbugs
[INFO] Fork Value is true
     [java] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
     [java] SLF4J: Defaulting to no-operation (NOP) logger implementation
     [java] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
     [java] The following errors occurred during analysis:
     [java]   Can't get stack offset 0 from [] @ 14 in com.etas.ascet.ui.views.common.model.XtextEsdlModel.format : (Lorg.eclipse.emf.common.util.URI;)V
     [java]     java.lang.IllegalArgumentException: 0 is not a value stack offset
     [java]       At edu.umd.cs.findbugs.OpcodeStack.getStackItem(OpcodeStack.java:3195)
     [java]       At jp.skypencil.findbugs.slf4j.IllegalPassedClassDetector.memorizeResultOfClassLiteral(IllegalPassedClassDetector.java:69)
     [java]       At jp.skypencil.findbugs.slf4j.IllegalPassedClassDetector.afterOpcode(IllegalPassedClassDetector.java:44)
     [java]       At edu.umd.cs.findbugs.visitclass.DismantleBytecode.visit(DismantleBytecode.java:884)
     [java]       At edu.umd.cs.findbugs.visitclass.BetterVisitor.visitCode(BetterVisitor.java:218)
     [java]       At edu.umd.cs.findbugs.visitclass.PreorderVisitor.visitCode(PreorderVisitor.java:243)
     [java]       At edu.umd.cs.findbugs.bcel.OpcodeStackDetector.visitCode(OpcodeStackDetector.java:65)
     [java]       At org.apache.bcel.classfile.Code.accept(Code.java:132)
     [java]       At edu.umd.cs.findbugs.visitclass.PreorderVisitor.doVisitMethod(PreorderVisitor.java:315)
     [java]       At edu.umd.cs.findbugs.visitclass.PreorderVisitor.visitJavaClass(PreorderVisitor.java:403)
     [java]       At org.apache.bcel.classfile.JavaClass.accept(JavaClass.java:213)
     [java]       At edu.umd.cs.findbugs.BytecodeScanningDetector.visitClassContext(BytecodeScanningDetector.java:38)
     [java]       At edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:76)
     [java]       At edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1080)
     [java]       At edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:281)
     [java]       At edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:401)
     [java]       At edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1185)
     [java] Warnings generated: 21

The method signature in question looks like this:

@Override
public void format(@NonNull final URI formattedObjectUri) {

where NonNull is org.eclipse.jdt.annotations, and URI is org.eclipse.emf.common.util.URI

Anything I can additionally report to help debugging? It's unfortunately not open source.

@KengoTODA KengoTODA self-assigned this Feb 10, 2019
@KengoTODA
Copy link
Owner

Really interesting, it seems that your code has LDC or LDC_W but after this instruction there is no stack item in OpcodeStack. It should be impossible... I guess this problem comes from SpotBugs side.

If you cannot share the code, can you share the bytecode around program-counter 14 in this method? Or can you send .class file to me privately?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants