lahodaj commented on issue #9542:
URL: https://github.com/apache/netbeans/issues/9542#issuecomment-5203085775

   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[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