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/03/18 07:14:47 UTC

[GitHub] [netbeans] JaroslavTulach opened a new pull request #2813: Execute commit validation on JDK15

JaroslavTulach opened a new pull request #2813:
URL: https://github.com/apache/netbeans/pull/2813


   I am in a need to test `java.mx.projects` module on JDK15+ and I realized that our testing framework isn't really easy to use on JDK11+. As such I decided to return back to basics and fix at least commit validation. The first commit enables `ant commit-validation` on JDK15. Subsequent commits will fix the failures.


----------------------------------------------------------------
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 #2813: Execute commit validation on JDK15

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



##########
File path: nbbuild/templates/projectized.xml
##########
@@ -86,7 +86,46 @@
         <property name="have-custom-javac-task" value="true" />
     </target>
 
-    <target name="build-init" depends="basic-init,jdk-8-check,set-buildnumber,-define-custom-javac-task">
+    <target name="-init-bootclasspath-prepend" depends="basic-init,jdk-8-check,set-buildnumber,-define-custom-javac-task" unless="have-jdk-1.9">

Review comment:
       It might be better to augment the conditions below that test for `test.use.jdk.javac` to also include `have-jdk1.9`, rather than skipping this completely, so that the `bootclasspath.prepend` is set for compilation.

##########
File path: platform/o.n.bootstrap/src/org/netbeans/Util.java
##########
@@ -170,6 +171,9 @@ public static boolean checkPackageDependency(Dependency dep, ClassLoader cl) thr
             } else {
                 pkg = Package.getPackage(packageName);
             }
+            if (pkg == null && sampleClass != null) {
+                pkg = sampleClass.getPackage();

Review comment:
       Thanks for the investigation!




-- 
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 #2813: Execute commit validation on JDK15 and JDK11

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


   


-- 
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 commented on a change in pull request #2813: Execute commit validation on JDK15

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



##########
File path: nbbuild/templates/projectized.xml
##########
@@ -86,7 +86,46 @@
         <property name="have-custom-javac-task" value="true" />
     </target>
 
-    <target name="build-init" depends="basic-init,jdk-8-check,set-buildnumber,-define-custom-javac-task">
+    <target name="-init-bootclasspath-prepend" depends="basic-init,jdk-8-check,set-buildnumber,-define-custom-javac-task" unless="have-jdk-1.9">

Review comment:
       I am not sure I understand, but I assume this has something to do with expected failure of [build on JDK-11](https://travis-ci.com/github/apache/netbeans/jobs/493533632) - `java.source.base` doesn't seen the nb-javac APIs during compilation.




-- 
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 commented on a change in pull request #2813: Execute commit validation on JDK15

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



##########
File path: nbbuild/templates/projectized.xml
##########
@@ -86,7 +86,46 @@
         <property name="have-custom-javac-task" value="true" />
     </target>
 
-    <target name="build-init" depends="basic-init,jdk-8-check,set-buildnumber,-define-custom-javac-task">
+    <target name="-init-bootclasspath-prepend" depends="basic-init,jdk-8-check,set-buildnumber,-define-custom-javac-task" unless="have-jdk-1.9">

Review comment:
       Addressed in eac2f44 




-- 
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 commented on a change in pull request #2813: Execute commit validation on JDK15

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



##########
File path: platform/o.n.bootstrap/src/org/netbeans/Util.java
##########
@@ -170,6 +171,9 @@ public static boolean checkPackageDependency(Dependency dep, ClassLoader cl) thr
             } else {
                 pkg = Package.getPackage(packageName);
             }
+            if (pkg == null && sampleClass != null) {
+                pkg = sampleClass.getPackage();

Review comment:
       I think this is correct behavior. We load the `sampleClass` and we are interested in its package. Not sure why used to be done in such a complicated way by throwing the `sampleClass` away. Anyway, @jlahoda wanted to know why it is working in the IDE and it is broken in the test. The `getPackage()` method traverses the `parent` classloaders and here is their list from bottom most to the application classloader:
   ```
   jdk.internal.loader.ClassLoaders$PlatformClassLoader
   org.netbeans.junit.NbModuleSuite$JUnitLoader
   java.net.URLClassLoader
   org.netbeans.Module$StandardClassLoader[debugger.jpda]
   ```
   the problem is probably caused by the `JUnitLoader` as it does its best to skip the application classloader (to force module classes to be loaded by module classloaders) and as 
   ```
   l.loadClass("com.sun.jdi.VirtualMachineManager").getClassLoader()
   $5 ==> jdk.internal.loader.ClassLoaders$AppClassLoader@5bc2b487
   ```
   when searching for the `com.sun.jdi` package, nobody asks the application classloader and the package is not found in the test.




----------------------------------------------------------------
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 commented on a change in pull request #2813: Execute commit validation on JDK15

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



##########
File path: platform/o.n.bootstrap/src/org/netbeans/Util.java
##########
@@ -170,6 +171,9 @@ public static boolean checkPackageDependency(Dependency dep, ClassLoader cl) thr
             } else {
                 pkg = Package.getPackage(packageName);
             }
+            if (pkg == null && sampleClass != null) {
+                pkg = sampleClass.getPackage();

Review comment:
       I think this is correct behavior. We load the `sampleClass` and we are interested in its package. Not sure why it was all handled in such a complicated way by throwing the `sampleClass` away. Anyway, @jlahoda wanted to know why it is working in the IDE and it is broken in the test. The `getPackage()` method traverses the `parent` classloaders and here is their list from bottom most to the application classloader:
   ```
   jdk.internal.loader.ClassLoaders$PlatformClassLoader
   org.netbeans.junit.NbModuleSuite$JUnitLoader
   java.net.URLClassLoader
   org.netbeans.Module$StandardClassLoader[debugger.jpda]
   ```
   the problem is probably caused by the `JUnitLoader` as it does its best to skip the application classloader (to force module classes to be loaded by module classloaders) and as 
   ```
   l.loadClass("com.sun.jdi.VirtualMachineManager").getClassLoader()
   $5 ==> jdk.internal.loader.ClassLoaders$AppClassLoader@5bc2b487
   ```
   when searching for the `com.sun.jdi` package, nobody asks the application classloader and the package is not found in the test.




----------------------------------------------------------------
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 commented on a change in pull request #2813: Execute commit validation on JDK15

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



##########
File path: platform/o.n.bootstrap/src/org/netbeans/Util.java
##########
@@ -170,6 +171,9 @@ public static boolean checkPackageDependency(Dependency dep, ClassLoader cl) thr
             } else {
                 pkg = Package.getPackage(packageName);
             }
+            if (pkg == null && sampleClass != null) {
+                pkg = sampleClass.getPackage();

Review comment:
       I think this is correct behavior. We load the `sampleClass` and we are interested in its package. Not sure why used to be done in such a complicated way by throwing the `sampleClass` away. Anyway, @jlahoda wanted to know why it is working in the IDE and it is broken in the test. The `getPackage()` method traverses the `parent` classloaders and here is their list from bottom most to the application classloader:
   ```
   jdk.internal.loader.ClassLoaders$PlatformClassLoader
   org.netbeans.junit.NbModuleSuite$JUnitLoader
   java.net.URLClassLoader
   org.netbeans.Module$StandardClassLoader[debugger.jpda]
   ```
   the problem is probably caused by the `JUnitLoader` as it does its best to skip the application classloader (to force module classes to be loaded by module classloaders) and as 
   ```
   l.loadClass("com.sun.jdi.VirtualMachineManager").getClassLoader()
   $5 ==> jdk.internal.loader.ClassLoaders$AppClassLoader@5bc2b487
   ```
   it is not found.




----------------------------------------------------------------
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 commented on a change in pull request #2813: Execute commit validation on JDK15

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



##########
File path: nbbuild/templates/projectized.xml
##########
@@ -86,7 +86,46 @@
         <property name="have-custom-javac-task" value="true" />
     </target>
 
-    <target name="build-init" depends="basic-init,jdk-8-check,set-buildnumber,-define-custom-javac-task">
+    <target name="-init-bootclasspath-prepend" depends="basic-init,jdk-8-check,set-buildnumber,-define-custom-javac-task" unless="have-jdk-1.9">

Review comment:
       I am not sure I understand, but I assume this has something to do with expected failure of [build on JDK-11](https://travis-ci.com/github/apache/netbeans/jobs/493533632) - `java.source.base` doesn't see the nb-javac APIs during compilation.




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