GitHub user lahodaj added a comment to the discussion: No constructors warning 
for HQL using DTO class constructor

NetBeans uses javac as a library to model the Java source code - for use in 
code completion, etc. I.e. there's a lot of code in NetBeans that directly 
links against the javac API, and it is not something that could (or should) be 
easily avoided or abstracted.

So, NetBeans has roughly three options:
- use an arbitrary older javac as the Java modeling library - like the 
suggested JDK 17. Then NetBeans would simply not understand any newer Java 
feature since JDK 18. This is obviously unfeasible.
- use an up-to-date javac as the modeling library (JDK 27's javac for NetBeans 
31, I believe). Then NetBeans supports up-to-date language features. And while 
the javac API evolution is not 100% compatible, the incompatibilities are 
small. So in this approach, well-behaved annotation processors are supported 
well. (Well-behaved: using the API, not breaking into internals.) The drawback 
is that not-well-behaved APs, like Lombok, have troubles when they don't 
support the up-to-date internals.
- support linking against multiple javac versions (but always run against a 
single javac version at runtime). We did this for some time in the past, and 
there are two problems: a) causes unmaintainable reflection mess, when trying 
to use a newer Java model - this actually escalates quite quickly; b) javac is 
getting more stable over time, so using an older version of javac can lead to 
additional crashes/exceptions/broken stuff, especially in presence of erroneous 
code.

I think use of up-to-date javac is the only viable option. It is unfortunate 
that Lombok sometimes does not work, but I would say that's more a deficiency 
in Lombok, that it touches internals/non-API. And that the onus is on them to 
keep Lombok up-to-date with javac internals if they opt to rely on the 
internals.


GitHub link: 
https://github.com/apache/netbeans/discussions/9552#discussioncomment-17966425

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to