jtulach commented on pull request #2761: URL: https://github.com/apache/netbeans/pull/2761#issuecomment-782893558
> This looks interesting and an improvement. It is a small step forward (e.g. we still support compilation with JDK8 as @neilcsmith-net requested) but I believe it is a step in the right direction. The most visible improvement is the dropping of `permit.jdk9.builds` flag. Now we can compile with JDK8+ and always get the same result (except maybe few modules where we continue to use `bootclasspath` and the `--release 8` API isn't enforced). > I noticed some changes to `build.xml` files, which add `release="8" target="1.8" ` - on JDK 9+ target is not necessary, as release substitutes it. I would expect target to default to 8 on JDK 8, so this feels like a duplicate. The `release` flag is ignored on JDK8, so I am specifying both `release` and `target`. It feels safer to be explicit than to rely on some defaults. Anyway the outcome is important - and that's what is verified by the commit validation `ValidateClassFilesTest`. > Why is `javac.default.target` overriden to `1.8`, instead of relying on the default behavior in `nbbuild/templates/common.xml` - there the default target is initialized to `javac.source`, which sounds sane to me? @lkishalmi [decided we want our modules to use JDK8](https://lists.apache.org/thread.html/r134fbdcee2583ceffab545827a260a2a8983a77a00c3bcec06271a3c%40%3Cdev.netbeans.apache.org%3E) whenever there is a [clash between the `javac.target` and the used API](https://lists.apache.org/thread.html/r42038bdaa1f66e44f20bc4f22482e8a246e8e28e61b6f5c2e92b837c%40%3Cdev.netbeans.apache.org%3E). One option to achieve that is to set source and target explicitly to `1.8` in all such modules. The other option was to make sure the default for NetBeans is `1.8`. Laszlo wrote _"let the past go"_, so I decided to go with the second option. > There are adjustments to `javac.target` but not `javac.source`. This I don't understand - is the intention here to allow javac to generate more modern code, that uses features only present on Java 8+, but not suffer from code incompatibilites by using old source parser/behavior? The value of `javac.target` influences not just generated bytecode, but also the API one compiles against (via the `--release` flag). I bumped `javac.target=1.8` with a `sed`-like utility. But that wasn't enough, so I also updated the default. The `javac.source` hasn't been changed as @jlahoda warned that it could change the semantics. ---------------------------------------------------------------- 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
