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

Sonar scanner raises IllegalArgumentExceptions for 20 findbug detectors on one class #1083

Open
camproto opened this issue Nov 26, 2024 · 4 comments

Comments

@camproto
Copy link

Issue Description

Sonar scanner raises IllegalArgumentException for 20 findbugs detectors for one class. The error message "can't push void" does not help me to see the reason. Therefore I cannot fix the class source code.

See log extract.
sonar-scanner-java-findbugs-exception-log.txt

Environment

Component Version
SonarQube Community Edition - Version 9.9.3 (build 79811)
sonar scanner 5.0.0.4389
Sonar-FindBugs findbugs 4.2.9
Maven mvnw 3.9.9
Java RedHat_JDK17.0.5.0.8
@gtoison
Copy link
Contributor

gtoison commented Nov 26, 2024

Hello, this seems to be an error in SpotBugs, when it tries to find the type returned by a method.
Reading the code it is not obvious what might be happening but I suspect the issue might be with a generics method signature.
Would you be able to share more information about the class triggering the bug?

@camproto
Copy link
Author

Hello Guillaume, thank you for your reply.
I cannot share the whole source code here, because it is from a closed source project.

The class is a Log4j layout, extends AbstractStringLayout, quite comprehensive with 350 lines. Deals with exception stacktrace formatting and create a JSON format for logging output.

Generics are not used in this class at all. What I think is special is the usage of 2 static final classes for grouping constants, one public and one private. The public one was before package visible only, what I guessed could be a missing type. But still after the change to public for the class and the constants within the exceptions arises.

Would appreciate if you had any more idea. Will clarify if I can share may be method signatures only.

@camproto
Copy link
Author

I let the sonar scanner run localy and remove parts of the source of this class to find the line with the problem.

@gtoison
Copy link
Contributor

gtoison commented Nov 27, 2024

Thank you, if you are willing it is also possible to debug this locally using mvnDebug instead of mvn

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