-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Lombok in Java 9 makes Netbeans 9.0 go crazy #1617
Comments
victorwss
added a commit
to victorwss/lombok
that referenced
this issue
Mar 24, 2018
Signed-off-by: Victor Williams Stafusa da Silva <[email protected]>
Relevant PR: #1626 |
rzwitserloot
added a commit
that referenced
this issue
Apr 4, 2018
Merged related pull request. |
@rspilker @rzwitserloot Can we have an edge release with this? |
The edge release is available. |
tmurakam
added a commit
to tmurakam/lombok
that referenced
this issue
Apr 16, 2018
…ontain authority part. fix degrade of projectlombok#1617, the file URI must starts with 'file:///', not 'file://'.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I already reported this here sometime ago. [Edit: It was in #1435. It also relates to #985]
Trying to use lombok in Java 9 within a Netbeans 9.0 project makes the IDE go crazy spamming a lot of
IllegalArgumentException: URI is not absolute
exceptions making it unusable.The cause of the issue is that Netbeans 9.0 uses
javax.tools.JavaFileObject
instances and callstoUri().toURL()
on them. But this happens in code specific to handle modules, so it will only trigger in Java 9. To be precise, this happens in theorg.netbeans.modules.java.source.parsing.PatchModuleFileManager.java
class.The
toURL()
method throws that exception when it is called in a URI that is not constructed as an absolute URI. This was never a problem until now, but now it is.The
JavaFileObject
javadocs do not say anything about requiring or not that the URIs should be absolute. Jan Lahoda from the Netbeans project replied:After hacking around lombok, I determined that the offending
JavaFileObject
is an instance oflombok.javac.apt.EmptyLombokFileObject
. The name which produces the bad URI islombok.dummy.ForceNewRound0
and it is produced in theforceNewRound(String, JavacFiler)
method of thelombok.javac.apt.LombokProcessor
class.A simple fix would be to rewrite the
toUri()
method ofEmptyLombokFileObject
. Instead of this:Let's use this:
After that, I:
And, it worked like a charm. A simple one-line fix!
Ok, to be fair, I had to twist some other things in order to make it able to compile in my Java 9 environment, but this is for some other issue. I don't think that this is really important here, but I should say it anyway in the case of somebody else failing to reproduce my fix.
Should I submit a PR on that?
Side note: Some people on Netbeans side are very angry about lombok due to unhappy past iteractions here. Surely, there are many things that we all could improve...
The text was updated successfully, but these errors were encountered: