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

Netbeans 8.x compile on save not working with lombok 1.16.20 #1577

Closed
Massinissab opened this issue Feb 13, 2018 · 13 comments
Closed

Netbeans 8.x compile on save not working with lombok 1.16.20 #1577

Massinissab opened this issue Feb 13, 2018 · 13 comments

Comments

@Massinissab
Copy link

During debugging of my application I'm used to use hot code replace.
This feature of netbeans allows to replace code on a running jvm.
To make it work you have to enable "compile on save".
So, with lombok 1.16.18 all is working good but with the new version 1.16.20, the hot code replace feature doesn't work.
I can see that my compiled class are removed from the target folder when hitting the save button (I'm working with maven).

@AlexFalappa
Copy link

May be related to #1592 that I just reported. Do you get the same tooltip?

@Massinissab
Copy link
Author

Massinissab commented Feb 28, 2018

No I didn't get the same tooltip.
As I mentionned above, the only trouble I got is that, when I hit save button, the current class is removed from the target directory. Even if there's no lombok annotation on the class.
I face this issue since I use lombok 1.16.20. Before this upgrade all was OK.
The bugged feature is "compile on save". The last lombok release make it fail.

@AlexFalappa
Copy link

@Massinissab I can confirm this issue, in NetBeans 8.2 the IDE is aware of Lombok generated methods but compile on save deletes the class.

@balta3
Copy link
Contributor

balta3 commented Mar 16, 2018

I stepped through the commits and 4710d20 seems to be the breaking commit

@victorwss
Copy link
Contributor

@AlexFalappa, @Massinissab, @balta3 Which JDK are you using to run Netbeans? From which JDK is the compiler invoked? Maybe an if before the replaceFileManagerJdk9 to not invoke it when running on JDK <= 8 could solve this?

@Massinissab
Copy link
Author

@victorwss I'm running netbeans with jdk8. The compiler is invoked from the same jdk.

@AlexFalappa
Copy link

@victorwss I'm on JDK8 too

@balta3
Copy link
Contributor

balta3 commented Mar 29, 2018

@victorwss I'm running JDK 9

@Massinissab
Copy link
Author

@victorwss I'm using jdk8 to run netbeans. Same to compile.

@nayomnik
Copy link

same with GWT. doent compile even if 'compile on save' is checked.

@michael-rhoese
Copy link

Same with Netbeans8.2, Oracle JDK8 and Lombok 1.18.0.

@charphi
Copy link
Contributor

charphi commented Jul 2, 2018

Same with NetBeans 8.2, Oracle JDK8 1.8.0_171 and Lombok 1.18.0.

Note that it works fine with Lombok 1.16.18.

@charphi
Copy link
Contributor

charphi commented Jul 11, 2018

I confirm that the problem comes from LombokProcessor#replaceFileManagerJdk9.

Unfortunately, checking for java compiler version is not enough to prevent the bug.
For example, my current config (NetBeans 8.2 + JDK8 + JDK10) returns 9 when calling Javac#getJavaCompilerVersion() during compile-on-save even if JDK8 is the only JDK configured in the ide.

So I have added a second test to check if the compilation is done during compile-on-save: JavacHandlerUtil#inNetbeansCompileOnSave(Context).

It seems to work properly with NetBeans 8.2 (I haven't tested it on NetBeans 9).

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

7 participants