dukescript opened a new pull request #2337:
URL: https://github.com/apache/netbeans/pull/2337


   A method of [using modern Java code 
concepts](https://repo1.maven.org/maven2/org/frgaal/compiler/14.0.2/compiler-14.0.2-README.pdf)
 while retaining compatibility with JDK 1.8 has recently come to our attention. 
There has been numerous requests to drop support for running NetBeans on JDK 
1.8, but there have always been objections to do so. This PR tries to balance 
such objections with the need of NetBeans codebase to get the best of modern 
Java.
   
   First of all there is a [small enhancement to the build 
system](https://github.com/apache/netbeans/commit/b53e2cf21a421773c2abee51effaeafbfa7b527b).
 If the in `nbproject/project.properties` specified `javac.source` is higher 
than `javac.target`, then the [backporting 
compiler](https://repo1.maven.org/maven2/org/frgaal/compiler/14.0.2/compiler-14.0.2-README.pdf)
 is triggered to handle the compilation. That allows one to use modern concepts 
like `var` and still produce JDK 1.8 compatible bytecode - this feature has 
been used in [maven.htmlui 
module](https://github.com/apache/netbeans/commit/6066163168eb0e76a5d2f0f40897b1b8f87d52ab)
 to demonstrate that the compiler works as expected. The biggest benefit has 
however been observed on [api.html 
module](https://github.com/apache/netbeans/commit/938b7d26695511809f1ebae00a4cf6763edcc357)
 - by replacing string concatenation with text blocks, the readability improved 
a lot.
   
   We believe this PR helps to find balance between those who want to write 
modern code and those who need to execute it on older JVMs. We'd like to use 
the [backporting 
compiler](https://repo1.maven.org/maven2/org/frgaal/compiler/14.0.2/compiler-14.0.2-README.pdf)
 in the modules we maintain. Once this PR is in, others may opt-in and use this 
feature by setting `javac.source=14` and `javac.target=1.8` in appropriate 
module configuration files. 


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