JaroslavTulach commented on pull request #2337:
URL: https://github.com/apache/netbeans/pull/2337#issuecomment-688160644


   > There has been numerous requests to drop support for running NetBeans on 
JDK 1.8, but there have always been objections to do so. 
   
   Let me speak up on behalf of those "having objections" against dropping JDK 
1.8 support. I don't feel real need to use the modern Java syntax like `var`, 
`x = switch`, `instanceof String s`, etc. It is just a syntactic sugar which 
can be written in JDK8 syntax as well. On the other hand I respect others who 
want to use modern Java - the syntax is nicer. This PR shows it is possible to 
have both and that is great to hear!
   
   However more than the new syntax I like the ability to compile against 
modern Java APIs as described in the "Systems Paths" section at the 
http://frgaal.org web page. I've just tried it in NetBeans and it is enough to 
put `nbproject/project.properties`:
   ```
   javac.target=11
   javac.source=14
   ```
   and then one can use JDK11 APIs. E.g. it is possible to write `Class<?> c = 
java.lang.Module.class` and the project compiles on JDK8! Moreover join this 
with existing support for automatically adding 
`OpenIDE-Module-Java-Dependencies: Java > 11` and I see nirvana: it is possible 
to have special bridge modules that provide access to future JDK APIs without 
reflection and that is amazing! 
   
   I don't see much problems adopting this retrofit compiler for Java on an 
opt-in bases. We know the syntax is going to be supported in JDK14+ - once 
NetBeans requires JDK17 LTS for compilation, we can drop the special compiler. 
On the other hand, I prefer a fixed compiler (and especially fixed APIs) to 
random compiler coming from the JDK - this is how Kotlin is used (e.g. one 
specifies the version of the compiler in `pom.xml`) and I find it very clever & 
comfortable. I am not aware of any problems related to JavaScript parser (if 
anyone felt strongly about it, he would upgrade to newer version of the 
library, right?) and moreover in this case we are talking only about 
compile-time dependency. Should everything go in vain, then we rewrite (or 
rather automatically refactor with 
[Jackpot](https://netbeans.apache.org/jackpot/index.html)) the code to old 
patterns.
   
   +1 to allow opt-in usage of this retrofit compiler to build NetBeans code 
base. I hope @matthiasblaesing changes his -1 opinion as well.


----------------------------------------------------------------
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.

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