-
Notifications
You must be signed in to change notification settings - Fork 843
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
-Xlint:all breaks nb-javac 21 #6826
Comments
dump file:
|
Thank you for the report. This seems to be a bug in nb-javac and is trivially reproducible for me in a recent build from master. To reproduce I cloned https://github.com/jjazzboss/JJazzLab, opened the main folder in NetBeans double clicked on "MixConsole" and the background scan began to flood the message log with the exception documented above. @dbalek you created the current build of nb-javac. I wanted to have a closer look, but the version information a) could you please have a look at the general problem and |
@matthiasblaesing i was wondering about that too when i reviewed the PR, so i wrote it down: #6425 (comment) It should be 21+35 edit: I tested it with nb-javac uninstalled on JDK 21.0.1 and got the same CCE in javac |
@mbien thank you. I was able to narrow this down some more. Maven project with source: test.zip The reproducer holds a single class: package test;
public class Demo {
public Demo() {
Test2.test();
}
} This is used to trigger the error. The "knob" for checking is in the pom: <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<release>17</release>
<!-- <compilerArgs>
<arg>-Xlint:all</arg>
</compilerArgs>-->
</configuration>
</plugin>
</plugins>
</build>
</project> With the shown configuration, all is fine. When opening the test project, NetBeans correctly flags Now remove the comment symbols around the Add the comment symbols around To me this looks like either a bug in the Anyway, this needs to be fixed. @lahodaj could you please have a look at this? You worked in the area of the @jjazzboss I modified the main --- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,7 @@
<jjazzlab.javac.fork>false</jjazzlab.javac.fork>
<jjazzlab.javac.showDeprecation>true</jjazzlab.javac.showDeprecation>
<jjazzlab.javac.showWarnings>true</jjazzlab.javac.showWarnings>
- <jjazzlab.javac.xlint>-Xlint:all</jjazzlab.javac.xlint>
+ <jjazzlab.javac.xlint></jjazzlab.javac.xlint>
<jjazzlab.surefire.plugin.version>3.1.0</jjazzlab.surefire.plugin.version>
<jjazzlab.surefire.skipTests>true</jjazzlab.surefire.skipTests>
<jjazzlab.forceEnglish>false</jjazzlab.forceEnglish> And after switching the project to JDK 17, building it, restarting once, the project opens clean for me on a NetBeans, that is not that far from master. Given the analysis above, this seems sensible. |
Thanks for the |
Thanks for the report, filled: |
@lahodaj thank you, that was quick. I tested your patch in nb-javac and it seems to fix the issue. I did this: I checked out the |
@matthiasblaesing nb-javac did backport patches in past, should be easy to re-enable if needed: JaroslavTulach/nb-javac@79510f4 Although it would be better if the change would be backported within openjdk itself or course, given that JDK 21 is LTS. it would be also interesting to experiment with nb-javac artifacts at JDK 11 language/api level, since this would remove the jackpot step entirely and might allow to provide nb-javac as java module #6817. Upstream Javac is buildable on JDK 11 without code transformation as projects like https://github.com/kohlschutter/jdk.compiler.standalone demonstrate. |
the bugfix was backported to JDK 22u: but I think the javac we merged (build 33) is older: so NB 22 in master would be still affected as far as I see. cc @dbalek @jtulach |
I've opened a backport to JDK 22, but then it unfortunately slipped through, so this was only fixed in JDK 22u. Yes, I think we'll need to upgrade to JDK 22u - hopefully won't be too difficult. |
JaroslavTulach/nb-javac#22 we could potentially still get the update in |
would be fixed by this nb-javac update #7366 |
Apache NetBeans version
Apache NetBeans 20 release candidate
What happened
I noticed that some IDE hints were not working anymore and there was this exception.
How to reproduce
No idea how to reproduce. The file I was editing:
Did this work correctly in an earlier version?
No / Don't know
Operating System
Win 11
JDK
JDK 17 x64 Adoptium
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
Tried restarting Netbeans, had the same problem a few times. It seems that when there is eventually compilable, error is gone.
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered: