You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/02/14 07:21:51 UTC

[GitHub] [netbeans] jtulach opened a new pull request #2761: Towards building just on JDK11.

jtulach opened a new pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761


   As observed by Jan: [lookup module requires 1.8](https://lists.apache.org/thread.html/r082d9d71ed5227a0f6610cd03ddfd64bf7b7661dfe848f885fccf850%40%3Cdev.netbeans.apache.org%3E) - e.g. every module that depends on it, requires JDK8 as well.
   
   1. let's update the `javac.target` to `1.8`


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] JaroslavTulach merged pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
JaroslavTulach merged pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach edited a comment on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
jtulach edited a comment on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-782810282


   To use the Ant's `<javac release="8"/>` tag I had to upgrade travis to use Ubuntu 18.04 which provides newer Ant. That triggered a lot of new failures as the "bionic" docker image is no longer using OracleJDK, but OpenJDK. OpenJDK doesn't have JavaFX installed. A lot of tests were failing due to that. Now everything seems to be fine.
   
   1067e68 adds new commit validation test - it checks if all the generated `.class` files are executable on JDK8. I am going to fix it now.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
jtulach commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-784843797


   The 3695501 fix is needed to accommodate new tests added by #2731 


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] lkishalmi commented on a change in pull request #2761: Towards building just on JDK11.

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on a change in pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#discussion_r577187116



##########
File path: platform/o.n.bootstrap/src/org/netbeans/StandardModuleData.java
##########
@@ -78,7 +80,12 @@ public StandardModuleData(Manifest mf, StandardModule forModule) throws InvalidE
         if (classPath != null) {
             StringTokenizer tok = new StringTokenizer(classPath);
             while (tok.hasMoreTokens()) {
-                String ext = tok.nextToken().replace("%20", " "); // NOI18N
+                String ext;
+                try {
+                    ext = URLDecoder.decode(tok.nextToken(), "UTF-8");
+                } catch (UnsupportedEncodingException ex) {
+                    throw new IllegalStateException(ex);
+                }
                 File extfile;
                 if (ext.equals("${java.home}/lib/ext/jfxrt.jar")) { // NOI18N

Review comment:
       It seems we do not really require that $ sign.
   Also there are some JDK 1.7 checks which could be removed as well.

##########
File path: platform/libs.javafx/manifest.mf
##########
@@ -38,5 +38,4 @@ OpenIDE-Module-Provides: javafx.animation,
     javafx.util,
     javafx.util.converter,
     netscape.javascript
-Class-Path: ${java.home}/lib/ext/jfxrt.jar
-
+Class-Path: %24%7Bjava.home%7D%2F/lib/ext/jfxrt.jar

Review comment:
       Well, this is ugly. Cant we just have JAVA_HOME/lib/ext/jfxrt.jar ?
   




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] neilcsmith-net commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-780744154


   @matthiasblaesing yes, Ant basically ignores it (unlike Maven which requires fun with profiles).  So it should be pretty safe to allow both, seen as 8 is the only option without "release" that will work?  Dropping support entirely for compiling on JDK 8 seems a bigger step to take, particularly given we produce source releases.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-787094888


   @jtulach @jlahoda I'm not sure, but I think I seen an issue with the module path in netbeans with this change (I don't think the change is broken, just another adjustment, that is needed).
   
   I can build NetBeans with JDK 8 and JDK 11 and system ant just fine. So it is not a general problem, but when opening netbeans modules in the IDE, I see issues.
   
   I run a build from current master and open the project `openide.util.lookup`. When the IDE is loaded on JDK 8, the modules can be rebuild using "Clean and Build" from the context menu. 
   
   ```
   Compiling 31 source files to /home/matthias/src/netbeans/platform/openide.util.lookup/build/classes
   Ignoring source, target and bootclasspath as release has been set
   error: release version 8 not supported
   Usage: javac <options> <source files>
   use --help for a list of possible options
   ```
   
   I tracked this down into the java compiler source in (I used git sources from jdk-11+28):
   
   src/jdk.compiler/share/classes/com/sun/tools/javac/platform/PlatformUtils.java
   
   If I understand it correctly, the list of PlatformProviders is empty, while it should at least provide `com.sun.tools.javac.platform.JDKPlatformProvider`.
   
   I have some hope that one of you two has an idea how to fix this.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach commented on a change in pull request #2761: Towards building just on JDK11.

Posted by GitBox <gi...@apache.org>.
jtulach commented on a change in pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#discussion_r577349817



##########
File path: platform/libs.javafx/manifest.mf
##########
@@ -38,5 +38,4 @@ OpenIDE-Module-Provides: javafx.animation,
     javafx.util,
     javafx.util.converter,
     netscape.javascript
-Class-Path: ${java.home}/lib/ext/jfxrt.jar
-
+Class-Path: %24%7Bjava.home%7D%2F/lib/ext/jfxrt.jar

Review comment:
       Very ugly, I agree. I was also considering defining some new token instead of `${java.home}`, but that would mean API changes, versioning, etc. At the end I decided to apply a [simple bugfix](https://github.com/apache/netbeans/pull/2761#discussion_r577187116).




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-782874386


   This looks interesting and an improvement. I have the following remarks/questions:
   
   - 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?
   - 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?
   - 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 bump of the baseline linux distribution for unittests looks sane to me. Thank you for working on this.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach edited a comment on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
jtulach edited a comment on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-784843797


   The 0c11e9e fix is needed to accommodate new tests added by #2731 


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-780739665


   > +1 to the changes so far, -1 to the title. Not sure we're ready for dropping building on JDK 8? And so far this does build fine with it.
   
   I understood, that the aim is to build with the "release" option from javac. That was added with java 9 and is not present on 8. It would be possible that ant emulates release 8 on JDK 8 by just using the classpath, but it would IMHO not be correct.
   
   Bumping target version is not that interesting to me.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-784493200


   @ebresie I had a look at the history of the README and the ant version is there since the beginning. I also remember, that there were broken ant installations in various linux distributions, I would keep it as is. People reading the README have no problem, all people with recent ant version have no problem, only people on ant version which should never  have been used to build netbeans will see the message.
   
   Lets get this in.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jlahoda commented on a change in pull request #2761: Towards building just on JDK11.

Posted by GitBox <gi...@apache.org>.
jlahoda commented on a change in pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#discussion_r577364472



##########
File path: platform/o.n.bootstrap/src/org/netbeans/StandardModuleData.java
##########
@@ -78,7 +80,12 @@ public StandardModuleData(Manifest mf, StandardModule forModule) throws InvalidE
         if (classPath != null) {
             StringTokenizer tok = new StringTokenizer(classPath);
             while (tok.hasMoreTokens()) {
-                String ext = tok.nextToken().replace("%20", " "); // NOI18N
+                String ext;
+                try {
+                    ext = URLDecoder.decode(tok.nextToken(), "UTF-8");
+                } catch (UnsupportedEncodingException ex) {
+                    throw new IllegalStateException(ex);
+                }
                 File extfile;
                 if (ext.equals("${java.home}/lib/ext/jfxrt.jar")) { // NOI18N

Review comment:
       FWIW, you can probably use `java.nio.charset.StandardCharsets.UTF_8` instead of `"UTF-8"`, and avoid the need to handle the `UnsupportedEncodingException`.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach commented on a change in pull request #2761: Towards building just on JDK11.

Posted by GitBox <gi...@apache.org>.
jtulach commented on a change in pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#discussion_r577377164



##########
File path: platform/o.n.bootstrap/src/org/netbeans/StandardModuleData.java
##########
@@ -78,7 +80,12 @@ public StandardModuleData(Manifest mf, StandardModule forModule) throws InvalidE
         if (classPath != null) {
             StringTokenizer tok = new StringTokenizer(classPath);
             while (tok.hasMoreTokens()) {
-                String ext = tok.nextToken().replace("%20", " "); // NOI18N
+                String ext;
+                try {
+                    ext = URLDecoder.decode(tok.nextToken(), "UTF-8");
+                } catch (UnsupportedEncodingException ex) {
+                    throw new IllegalStateException(ex);
+                }
                 File extfile;
                 if (ext.equals("${java.home}/lib/ext/jfxrt.jar")) { // NOI18N

Review comment:
       Alas, I cannot. That method has been added in JDK10! While it seems available in the editor, when compiling with the new `--release 8` the compilation fails. I tried and had to revert back to specifying the encoding as string and catching the exception.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] neilcsmith-net commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-784254757


   > Once this rolls out, recommend update the readme.md to account for changes
   
   Actually, that's a good point - that doc change might be better included in this PR?


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach commented on a change in pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
jtulach commented on a change in pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#discussion_r579974122



##########
File path: platform/o.n.core/test/qa-functional/src/org/netbeans/core/validation/ValidateClassFilesTest.java
##########
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.core.validation;
+
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.FileVisitResult;
+import java.nio.file.FileVisitor;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.Enumeration;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import junit.framework.Test;
+import org.netbeans.junit.NbModuleSuite;
+import org.netbeans.junit.NbTestCase;
+
+public class ValidateClassFilesTest extends NbTestCase {
+    public ValidateClassFilesTest(String name) {
+        super(name);
+    }
+
+    public static Test suite() {
+        return NbModuleSuite.createConfiguration(ValidateClassFilesTest.class).
+                clusters(".*").gui(false).honorAutoloadEager(true).suite();
+    }
+
+    public void testCheckClassFiles() throws IOException {

Review comment:
       Yes, the goal is to ensure class version is at most 52 (Java 8) unless otherwise stated. Right now there is an exception for `extra/modules/*javafx*.jar` which are only available/used on JDK11.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on a change in pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on a change in pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#discussion_r579858063



##########
File path: java/api.debugger.jpda/nbproject/project.properties
##########
@@ -21,6 +21,7 @@ javac.compilerargs=-Xlint:unchecked
 javac.source=1.8
 javadoc.arch=${basedir}/arch.xml
 javadoc.apichanges=${basedir}/apichanges.xml
+bootclasspath.prepend=${build.dir}/disable-release

Review comment:
       I assume this line is intended to disable setting the release flag as the module links against internal classes?

##########
File path: platform/o.n.core/test/qa-functional/src/org/netbeans/core/validation/ValidateClassFilesTest.java
##########
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.core.validation;
+
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.FileVisitResult;
+import java.nio.file.FileVisitor;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.Enumeration;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import junit.framework.Test;
+import org.netbeans.junit.NbModuleSuite;
+import org.netbeans.junit.NbTestCase;
+
+public class ValidateClassFilesTest extends NbTestCase {
+    public ValidateClassFilesTest(String name) {
+        super(name);
+    }
+
+    public static Test suite() {
+        return NbModuleSuite.createConfiguration(ValidateClassFilesTest.class).
+                clusters(".*").gui(false).honorAutoloadEager(true).suite();
+    }
+
+    public void testCheckClassFiles() throws IOException {

Review comment:
       Am I reading this right, that this fixates the class versions for _all_ modules to 52 (Java 8?)? If so I don't like this. At this point in time, this might be right (and are we really dropping profiler support for Java prior to 8?), but I see a valid path in the future, where we switch to JDK 11 as boot JDK and will want to be able to use JDK 9+ bytecode for example for modern implementations, that only run on newer JDKs. 

##########
File path: enterprise/web.monitor/build.xml
##########
@@ -27,7 +27,7 @@
 
     <target name="compile-server" depends="init,compile">
         <mkdir dir="build/server-classes"/>
-        <javac srcdir="serversrc" destdir="build/server-classes" deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}" source="${javac.source}" includeantruntime="false">
+        <javac srcdir="serversrc" destdir="build/server-classes" deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}" source="${javac.source}" release="8" target="1.8" includeantruntime="false">

Review comment:
       This is the http monitor for web container. I know at least one system where the production runtime, where a webcontainer is running and the java version is << 8. We should be aware, that this might lead to issue reports.

##########
File path: profiler/profiler/nbproject/project.properties
##########
@@ -20,6 +20,7 @@ is.autoload=true
 cp.extra=${tools.jar}
 
 javac.source=1.8
+bootclasspath.prepend=${build.dir}/disable-release

Review comment:
       I assume this is to disable setting "release" version as linking against com.sun classes happens. 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach commented on a change in pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
jtulach commented on a change in pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#discussion_r579975522



##########
File path: profiler/profiler/nbproject/project.properties
##########
@@ -20,6 +20,7 @@ is.autoload=true
 cp.extra=${tools.jar}
 
 javac.source=1.8
+bootclasspath.prepend=${build.dir}/disable-release

Review comment:
       Right: 94aebf0




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] ebresie commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
ebresie commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-784214090


   Once this rolls out, recommend update the readme.md to account for changes (i.e. sounds like the jdk9 ant parameter not needed, minimum ant version, if any new parameters are needed, etc.) 


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] Rareitor commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
Rareitor commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-802774539


   On a related note, should the instructions for building from source on the website (https://netbeans.apache.org/download/dev/index.html) be updated to note that the -Dpermit.jdk9.builds=true flag is not needed anymore?
   I did the last modification, but missed the chance to do it again.
   It would be an update for the next release anyway, since it still needs the flag to build.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
jtulach commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-783957394


   > BTW If you read that @lkishalmi decided in the comments, I'd mark that I do not decide, I merely suggest.
   
   Changing directions when the code is ready is costly. As such I [discussed the approach](https://lists.apache.org/thread.html/r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%3Cdev.netbeans.apache.org%3E) first, listened to the suggestions and implemented what seemed to be a mutually agreeable intersection.
   
   As soon as I started coding _the suggestions_ (hopefully correctly selected by me) have become _decisions_. I have attributed the _decisions_ to you guys to stress, that I did listen to your _suggestions_ before trying to move the project to the right direction without pushing it inappropriately too far.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] lkishalmi commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-785238256


   Geat job! Thank you!


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach commented on a change in pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
jtulach commented on a change in pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#discussion_r579975462



##########
File path: java/api.debugger.jpda/nbproject/project.properties
##########
@@ -21,6 +21,7 @@ javac.compilerargs=-Xlint:unchecked
 javac.source=1.8
 javadoc.arch=${basedir}/arch.xml
 javadoc.apichanges=${basedir}/apichanges.xml
+bootclasspath.prepend=${build.dir}/disable-release

Review comment:
       Right: 94aebf0




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
jtulach commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-782810282


   To use the Ant's `<javac release="8"/>` tag I had to upgrade to Ubuntu 18.04 which provides newer Ant. That triggered a lot of new failures as the "bionic" docker image is not longer using OracleJDK, but OpenJDK. OpenJDK doesn't have JavaFX installed. A lot of tests were failing due to that. Now everything seems to be fine.
   
   
   1067e68 adds new commit validation test - it checks if all the generated `.class` files are executable on JDK8. I am going to fix it now.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach commented on a change in pull request #2761: Towards building just on JDK11.

Posted by GitBox <gi...@apache.org>.
jtulach commented on a change in pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#discussion_r577351757



##########
File path: platform/o.n.bootstrap/src/org/netbeans/StandardModuleData.java
##########
@@ -78,7 +80,12 @@ public StandardModuleData(Manifest mf, StandardModule forModule) throws InvalidE
         if (classPath != null) {
             StringTokenizer tok = new StringTokenizer(classPath);
             while (tok.hasMoreTokens()) {
-                String ext = tok.nextToken().replace("%20", " "); // NOI18N
+                String ext;
+                try {
+                    ext = URLDecoder.decode(tok.nextToken(), "UTF-8");
+                } catch (UnsupportedEncodingException ex) {
+                    throw new IllegalStateException(ex);
+                }
                 File extfile;
                 if (ext.equals("${java.home}/lib/ext/jfxrt.jar")) { // NOI18N

Review comment:
       Yes, the `${java.home}` string is totally artificial. I have chosen it as it had no meaning for `javac` (in JDK8, who could expect JDK11 starts to recognize URLs in `Class-Path` attribute!).
   
   There already was some URI-like processing (replacing `%20` by ` `) and using `URLDecoder` (not available on JDK7 at the time of writing this code) can be seen as a "proper fix" of processing the URI component.
   
   Right, the JDK7 specific code can be removed. 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] neilcsmith-net commented on pull request #2761: Towards building just on JDK11.

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-780633026


   +1 to the changes so far, -1 to the title.  Not sure we're ready for dropping building on JDK 8?  And so far this does build fine with it.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach commented on a change in pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
jtulach commented on a change in pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#discussion_r579981286



##########
File path: enterprise/web.monitor/build.xml
##########
@@ -27,7 +27,7 @@
 
     <target name="compile-server" depends="init,compile">
         <mkdir dir="build/server-classes"/>
-        <javac srcdir="serversrc" destdir="build/server-classes" deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}" source="${javac.source}" includeantruntime="false">
+        <javac srcdir="serversrc" destdir="build/server-classes" deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}" source="${javac.source}" release="8" target="1.8" includeantruntime="false">

Review comment:
       Your concern may be valid, but the actual problem is the opposite. Make sure `nbjdk.home` isn't set and then try (on `12.3` without this PR):
   ```bash
   enterprise/web.monitor$ JAVA_HOME=/jdk-8 ant clean compile-server
   enterprise/web.monitor$ /jdk-11/bin/javap -v -cp build/server-classes/ org/netbeans/modules/web/monitor/server/Logger | grep -i Major -B 1
     minor version: 0
     major version: 52
   ```
   e.g. in all version of Apache NetBeans up to 12.3 the http monitor could only be executed on JDK8+. Now, try to compile on JDK11:
   ```bash
   enterprise/web.monitor$ JAVA_HOME=/jdk-11 ant -Dpermit.jdk9.builds=true clean compile-server
   enterprise/web.monitor$ /jdk-11/bin/javap -v -cp build/server-classes/ org/netbeans/modules/web/monitor/server/Logger | grep -i Major -B 1
     minor version: 0
     major version: 55
   ```
   See? If you compile on JDK11, the http monitor can only be executed on JDK11! According to documentation of [Ant Javac task](https://ant.apache.org/manual/Tasks/javac.html) it is highly desirable to set `target` - which is what this PR does.
   
   Btw. I have only discovered this problem by introducing the 1067e68 test. E.g. the purpose of the `ValidateClassFilesTest` isn't to _bump the target up to 1.8_, but prevent us to accidentally compile with _target higher than expected_.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] ebresie commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
ebresie commented on pull request #2761:
URL: https://github.com/apache/netbeans/pull/2761#issuecomment-784433005


   As long as considering readme items...readme says needs "Ant 1.9.9 or above" but commit 140cb7e reference to ant 1.9.8.  Does the 1.9.8 need to be changed to 1.9.9 to be in line with the doc? 


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] jtulach commented on pull request #2761: Towards building on JDK11 and running on JDK8

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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