-
Notifications
You must be signed in to change notification settings - Fork 618
Lambda methods reported as missing classes #527
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
Comments
The lambda representation makes no sense for XMethod "classical" instruction attributes are filled with garbage, causing the code later to produce crazy errors (looking for non existing types etc). We should NOT be called here from our code, but 3rd party code still may use this method. So *at least* provide a valid class name, which is (don't ask me why) is encoded in the first argument type of the lambda. But even this above I fear will surprise the callers and probably fail in some cases, so use Object as last "safe" resort. See issue #527
The lambda representation makes no sense for XMethod "classical" instruction attributes are filled with garbage, causing the code later to produce crazy errors (looking for non existing types etc). We should NOT be called here from our code, but 3rd party code still may use this method. So *at least* provide a valid class name, which is (don't ask me why) is encoded in the first argument type of the lambda. But even this above I fear will surprise the callers and probably fail in some cases, so use Object as last "safe" resort. See issue #527
Merged in 3.1 and master. |
This still happens in 3.1.11: <BugCollection version="3.1.11" sequence="0" tim.estamp="1550070145794" analysisTimestamp="1550075180425" release="">
...
<Errors errors="0" missingClasses="14">
<MissingClass>accept</MissingClass>
<MissingClass>actionPerformed</MissingClass>
<MissingClass>apply</MissingClass>
<MissingClass>changed</MissingClass>
<MissingClass>deliverSelectedHuman</MissingClass>
<MissingClass>get</MissingClass>
<MissingClass>getLineData</MissingClass>
<MissingClass>handle</MissingClass>
<MissingClass>handleEvent</MissingClass>
<MissingClass>makeConcatWithConstants</MissingClass>
<MissingClass>objectSelected</MissingClass>
<MissingClass>run</MissingClass>
<MissingClass>test</MissingClass>
<MissingClass>valueChanged</MissingClass>
</Errors>
<FindBugsSummary timestamp="Wed, 13 Feb 2019 16:02:25 +0100" total_classes="1193" referenced_classes="2829" total_bugs="114" total_size="64357" num_packages="124" java_version="11.0.1" vm_version="11.0.1+13" cpu_seconds="264.19" clock_seconds="104.04" peak_mbytes="4467.56" alloc_mbytes="3072.00" gc_seconds="1.93" priority_2="113" priority_1="1">
... |
I also tested with Java 8 and the SpotBugs 3.1.2 like in the milestone, there it is exactly the same. |
I can confirm, the issue still exists. |
In a bigger project I've using spotbugs to detect issues and I have these warning on the output while building:
I've created a small example to reproduce this bug. https://github.com/ati90ati/bugreport-spotbugs-gradle-plugin-logging In the repo I'm getting this unwanted output:
I hope that you guys can find a solution to fix this bug. |
Same issue for
|
On Maven, also can see this issue.
Stacktrace: |
still happens in SpotBugs 4.0.0 |
Pardon my dumb question, but do these warnings mean that the findbugs plugin didn't run at all, or simply worked, but couldn't find these classes? I wasn't able to understand what's exactly going on in the plugin when it encounters this error. |
The plugin worked, just the output was very disturbing, especially when you have more modules. |
I add this issue ~ 2 years ago, we were using an old Sonar version (v6.7.x), we were trying to migrate sonar to a newer version compatible with Java 11, but the false positive in the new Spotbug version used were blocking the pipelines. We needed to rollback to that Sonar version and at that time this was blocking us for example to migrate projects from Java 8 to 11.... |
@jonathansantilli I haven't noticed any problem in the behavior. Spotbugs seemed to work well, only it had a disturbing output. @DanielFran You can suppress warnings (even false positives) in Spotbugs so this shouldn't stop you to upgrade to Java 11 (some examples: https://github.com/undertow-io/undertow/blob/master/spotbugs-exclude.xml). |
Hello guys!
|
Still happens with 4.3.0. |
For Spotbugs, the Gradle plugin by default checks tests: teach Maven to do the same. Do note warnings from Spotbugs for (depending on your Java and/or platform version): - apply - call - execute - makeConcatWithConstants The complaint is "classes needed for analysis were missing", however, these are not classes in the usual sense, but internal JDK implementation details related to lambdas and `invokedynamic`. See spotbugs/spotbugs#527.
Still happening on 5.0.10... The following classes needed for analysis were missing: |
Using Java 11 still a problem, is there an celebration for this bugs 5th year anniversary? Off to 5 more years :) |
I only get this, i.e.
when I include findsecbugs <plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.7.3.4</version>
<configuration>
<plugins>
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>1.12.0</version>
</plugin>
</plugins>
</configuration>
|
Still a Bug after more than five years. |
In my case list is bigger:
jdk 20 |
It even got worse now, because it is reported once per report. |
@delanym I also only get this when using find-sec-bugs. |
@JuditKnoll you happen to know what could be done here? |
@soloturn I'm sorry, I don't know. I haven't looked into this issue properly, but for me it looks like it may be a find-sec-bugs issue. I'm not really familiar how exactly SpotBugs and its plugins interacts with each other. |
Version 1.13.0, released almost a month ago, of find-sec-bugs does not solve the problem for me. |
Version 1.13.0 of find-sec-bugs doesn't solve this, even with the |
This is a side effect of not properly supporting INVOKEDYNAMIC instruction (issue #6): the snippet below generates "The following classes needed for SpotBugs analysis on project A were missing: run" warning on every analysis in Eclipse.
This is most likely same as issue spotbugs/discuss/issues/29.
While we still lacks the proper INVOKEDYNAMIC support, we should at least make sure we don't raise stupid warnings.
The text was updated successfully, but these errors were encountered: