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 2018/04/02 21:11:44 UTC

[GitHub] geertjanw closed pull request #473: [NETBEANS-539] Attempting to add support for JDK 10 and beyond to pro���

geertjanw closed pull request #473: [NETBEANS-539] Attempting to add support for JDK 10 and beyond to pro…
URL: https://github.com/apache/incubator-netbeans/pull/473
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lib.profiler.common/src/org/netbeans/lib/profiler/common/integration/Bundle.properties b/lib.profiler.common/src/org/netbeans/lib/profiler/common/integration/Bundle.properties
index f43d1f560..149c3c9bf 100644
--- a/lib.profiler.common/src/org/netbeans/lib/profiler/common/integration/Bundle.properties
+++ b/lib.profiler.common/src/org/netbeans/lib/profiler/common/integration/Bundle.properties
@@ -21,6 +21,7 @@ IntegrationUtils_PlatformJava60=Java SE 6.0
 IntegrationUtils_PlatformJava70=Java SE 7.0
 IntegrationUtils_PlatformJava80=Java SE 8.0
 IntegrationUtils_PlatformJava90=Java SE 9.0
+IntegrationUtils_PlatformJava110=Java SE 10.0 or newer
 IntegrationUtils_PlatformJavaCvm=CVM
 IntegrationUtils_PlatformWindowsOs=Windows, 32bit JVM
 IntegrationUtils_PlatformWindowsAmd64Os=Windows, 64bit JVM
@@ -54,6 +55,7 @@ IntegrationUtils_Jdk60Name=Java SE 6 (JRE or JDK)
 IntegrationUtils_Jdk70Name=Java SE 7 (JRE or JDK)
 IntegrationUtils_Jdk80Name=Java SE 8 (JRE or JDK)
 IntegrationUtils_Jdk90Name=Java SE 9 (JRE or JDK)
+IntegrationUtils_Jdk110Name=Java SE 10 or newer (JRE or JDK)
 IntegrationUtils_JdkCvmName=CVM
 IntegrationUtils_RemoteString=remote
 # HTML-formatted
diff --git a/lib.profiler.common/src/org/netbeans/lib/profiler/common/integration/IntegrationUtils.java b/lib.profiler.common/src/org/netbeans/lib/profiler/common/integration/IntegrationUtils.java
index 42ac04233..358c5861d 100644
--- a/lib.profiler.common/src/org/netbeans/lib/profiler/common/integration/IntegrationUtils.java
+++ b/lib.profiler.common/src/org/netbeans/lib/profiler/common/integration/IntegrationUtils.java
@@ -48,6 +48,7 @@
     public static final String PLATFORM_JAVA_70 = messages.getString("IntegrationUtils_PlatformJava70"); // NOI18N
     public static final String PLATFORM_JAVA_80 = messages.getString("IntegrationUtils_PlatformJava80"); // NOI18N
     public static final String PLATFORM_JAVA_90 = messages.getString("IntegrationUtils_PlatformJava90"); // NOI18N
+    public static final String PLATFORM_JAVA_110_BEYOND = messages.getString("IntegrationUtils_PlatformJava110"); // NOI18N
     public static final String PLATFORM_JAVA_CVM = messages.getString("IntegrationUtils_PlatformJavaCvm"); // NOI18N
     public static final String PLATFORM_WINDOWS_OS = messages.getString("IntegrationUtils_PlatformWindowsOs"); // NOI18N
     public static final String PLATFORM_WINDOWS_AMD64_OS = messages.getString("IntegrationUtils_PlatformWindowsAmd64Os"); // NOI18N
@@ -74,6 +75,7 @@
     private static final String JDK_70_NAME = messages.getString("IntegrationUtils_Jdk70Name"); // NOI18N
     private static final String JDK_80_NAME = messages.getString("IntegrationUtils_Jdk80Name"); // NOI18N
     private static final String JDK_90_NAME = messages.getString("IntegrationUtils_Jdk90Name"); // NOI18N
+    private static final String JDK_110_BEYOND_NAME = messages.getString("IntegrationUtils_Jdk110Name"); // NOI18N
     private static final String JDK_CVM_NAME = messages.getString("IntegrationUtils_JdkCvmName"); // NOI18N
     private static final String HTML_REMOTE_STRING = "&lt;" + messages.getString("IntegrationUtils_RemoteString") + "&gt;"; // NOI18N
     private static final String EXPORT_SETENV_MESSAGE = messages.getString("IntegrationUtils_ExportSetenvMessage"); // NOI18N
@@ -308,6 +310,8 @@ public static String getJavaPlatformName(String javaPlatform) {
             return JDK_80_NAME;
         } else if (javaPlatform.equals(PLATFORM_JAVA_90)) {
             return JDK_90_NAME;
+        } else if (javaPlatform.equals(PLATFORM_JAVA_110_BEYOND)) {
+            return JDK_110_BEYOND_NAME;
         } else if (javaPlatform.equals(PLATFORM_JAVA_CVM)) {
             return JDK_CVM_NAME;
         }
@@ -327,6 +331,8 @@ public static String getJavaPlatformNativeLibrariesDirectoryName(String javaPlat
             return "jdk16"; //NOI18N // for JDK 8.0 we use the same as for 6.0 for now
         } else if (javaPlatform.equals(PLATFORM_JAVA_90)) {
             return "jdk16"; //NOI18N // for JDK 9.0 we use the same as for 6.0 for now
+        } else if (javaPlatform.equals(PLATFORM_JAVA_110_BEYOND)) {
+            return "jdk16"; //NOI18N // for JDK 10.0 and beyond we use the same as for 6.0 for now
         } else if (javaPlatform.equals(PLATFORM_JAVA_CVM)) {
             return "cvm";  // NOI18N
         }
@@ -369,6 +375,8 @@ public static String getLocalJavaPlatform() {
             return PLATFORM_JAVA_80;
         } else if (jdkVersion == Platform.JDK_19) {
             return PLATFORM_JAVA_90;
+        } else if (jdkVersion == Platform.JDK_110_BEYOND) {
+            return PLATFORM_JAVA_110_BEYOND;
         }
 
         return null;
@@ -529,7 +537,7 @@ public static String fixLibsDirPath(final String libsDirPath, final String args,
     public static String getRemoteProfilerAgentCommandLineArgsWithoutQuotes(
             String prefix, String targetPlatform, String targetJVM, int portNumber) {
         final StringBuilder args = new StringBuilder();
-        if ((targetJVM.equals(PLATFORM_JAVA_60) || targetJVM.equals(PLATFORM_JAVA_70) || targetJVM.equals(PLATFORM_JAVA_80) || targetJVM.equals(PLATFORM_JAVA_90)) &&
+        if ((targetJVM.equals(PLATFORM_JAVA_60) || targetJVM.equals(PLATFORM_JAVA_70) || targetJVM.equals(PLATFORM_JAVA_80) || targetJVM.equals(PLATFORM_JAVA_90) || targetJVM.equals(PLATFORM_JAVA_110_BEYOND)) &&
                 isLinuxPlatform(targetPlatform)) {
             args.append(" -XX:+UseLinuxPosixThreadCPUClocks "); // NOI18N
         }
@@ -543,7 +551,7 @@ public static String getProfilerAgentCommandLineArgsWithoutQuotes(String targetP
                                                                       int portNumber) {
         StringBuilder args = new StringBuilder();
         
-        if ((targetJVM.equals(PLATFORM_JAVA_60) || targetJVM.equals(PLATFORM_JAVA_70) || targetJVM.equals(PLATFORM_JAVA_80) || targetJVM.equals(PLATFORM_JAVA_90)) && 
+        if ((targetJVM.equals(PLATFORM_JAVA_60) || targetJVM.equals(PLATFORM_JAVA_70) || targetJVM.equals(PLATFORM_JAVA_80) || targetJVM.equals(PLATFORM_JAVA_90) || targetJVM.equals(PLATFORM_JAVA_110_BEYOND)) &&
             isLinuxPlatform(targetPlatform)) {
             args.append(" -XX:+UseLinuxPosixThreadCPUClocks "); // NOI18N
         }
@@ -557,7 +565,7 @@ public static String getProfilerAgentCommandLineArgsWithoutQuotes(String targetP
                                                                       int portNumber, String pathSpaceChar) {
         StringBuilder args = new StringBuilder();
         
-        if ((targetJVM.equals(PLATFORM_JAVA_60) || targetJVM.equals(PLATFORM_JAVA_70) || targetJVM.equals(PLATFORM_JAVA_80) || targetJVM.equals(PLATFORM_JAVA_90)) && 
+        if ((targetJVM.equals(PLATFORM_JAVA_60) || targetJVM.equals(PLATFORM_JAVA_70) || targetJVM.equals(PLATFORM_JAVA_80) || targetJVM.equals(PLATFORM_JAVA_90) || targetJVM.equals(PLATFORM_JAVA_110_BEYOND)) &&
             isLinuxPlatform(targetPlatform)) {
             args.append(" -XX:+UseLinuxPosixThreadCPUClocks "); // NOI18N
         }
diff --git a/lib.profiler/src/org/netbeans/lib/profiler/ProfilerClient.java b/lib.profiler/src/org/netbeans/lib/profiler/ProfilerClient.java
index 4d18f01e5..4d31ac8ac 100644
--- a/lib.profiler/src/org/netbeans/lib/profiler/ProfilerClient.java
+++ b/lib.profiler/src/org/netbeans/lib/profiler/ProfilerClient.java
@@ -1570,7 +1570,7 @@ private boolean setVMProperties(VMPropertiesResponse resp, boolean terminateOnEr
         status.startupTimeInCounts = resp.getStartupTimeInCounts();
         status.canInstrumentConstructor = resp.canInstrumentConstructor();
 
-        if (!status.remoteProfiling && settings.getTargetJDKVersionString() != CommonConstants.JDK_19_STRING) {
+        if (!status.remoteProfiling && settings.getTargetJDKVersionString() != CommonConstants.JDK_19_STRING && settings.getTargetJDKVersionString() != CommonConstants.JDK_110_BEYOND_STRING) {
             settings.setWorkingDir(resp.getWorkingDir());
             settings.setVMClassPaths(resp.getJavaClassPath(), resp.getJavaExtDirs(), resp.getBootClassPath());
             ClassRepository.initClassPaths(settings.getWorkingDir(), settings.getVMClassPaths());
diff --git a/lib.profiler/src/org/netbeans/lib/profiler/TargetAppRunner.java b/lib.profiler/src/org/netbeans/lib/profiler/TargetAppRunner.java
index ae12d2c56..2239a14c3 100644
--- a/lib.profiler/src/org/netbeans/lib/profiler/TargetAppRunner.java
+++ b/lib.profiler/src/org/netbeans/lib/profiler/TargetAppRunner.java
@@ -321,7 +321,8 @@ public boolean hasSupportedJDKForHeapDump() {
         if (CommonConstants.JDK_16_STRING.equals(jdkVersion)
            || CommonConstants.JDK_17_STRING.equals(jdkVersion)
            || CommonConstants.JDK_18_STRING.equals(jdkVersion)
-           || CommonConstants.JDK_19_STRING.equals(jdkVersion)) {
+           || CommonConstants.JDK_19_STRING.equals(jdkVersion)
+           || CommonConstants.JDK_110_BEYOND_STRING.equals(jdkVersion)) {
             return true;
         }
 
@@ -679,8 +680,9 @@ private boolean startTargetVM(String[] jvmArgs, String mainClassName, String[] m
         if (jdkVer.equals(JDK_16_STRING)
             || jdkVer.equals(JDK_17_STRING)
             || jdkVer.equals(JDK_18_STRING)
-            || jdkVer.equals(JDK_19_STRING)) {
-            // for now the 1.6 and 1.7 and 1.8 profiling uses the same agent as 1.5
+            || jdkVer.equals(JDK_19_STRING)
+            || jdkVer.equals(JDK_110_BEYOND_STRING)) {
+            // for now the 1.6, 1.7, 1.8, etc. profiling uses the same agent as 1.5
             jdkVer = JDK_15_STRING;
         }
 
@@ -734,7 +736,8 @@ private boolean startTargetVM(String[] jvmArgs, String mainClassName, String[] m
                 || settings.getTargetJDKVersionString().equals(Platform.JDK_16_STRING)
                 || settings.getTargetJDKVersionString().equals(Platform.JDK_17_STRING)
                 || settings.getTargetJDKVersionString().equals(Platform.JDK_18_STRING)
-                || settings.getTargetJDKVersionString().equals(Platform.JDK_19_STRING)) {
+                || settings.getTargetJDKVersionString().equals(Platform.JDK_19_STRING)
+                || settings.getTargetJDKVersionString().equals(Platform.JDK_110_BEYOND_STRING)) {
             String jfNativeLibFullName = Platform.getAgentNativeLibFullName(settings.getJFluidRootDirName(), false,
                                                                             settings.getTargetJDKVersionString(),
                                                                             settings.getSystemArchitecture());
diff --git a/lib.profiler/src/org/netbeans/lib/profiler/global/CalibrationDataFileIO.java b/lib.profiler/src/org/netbeans/lib/profiler/global/CalibrationDataFileIO.java
index f2d494c94..b2b07da0f 100644
--- a/lib.profiler/src/org/netbeans/lib/profiler/global/CalibrationDataFileIO.java
+++ b/lib.profiler/src/org/netbeans/lib/profiler/global/CalibrationDataFileIO.java
@@ -167,7 +167,8 @@ public static boolean validateCalibrationInput(String javaVersionString, String
                     || CommonConstants.JDK_16_STRING.equals(javaVersionString)
                     || CommonConstants.JDK_17_STRING.equals(javaVersionString)
                     || CommonConstants.JDK_18_STRING.equals(javaVersionString)
-                    || CommonConstants.JDK_19_STRING.equals(javaVersionString)) {
+                    || CommonConstants.JDK_19_STRING.equals(javaVersionString)
+                    || CommonConstants.JDK_110_BEYOND_STRING.equals(javaVersionString)) {
                 if (new File(javaExecutable).exists()) {
                     return true;
                 }
diff --git a/lib.profiler/src/org/netbeans/lib/profiler/global/CommonConstants.java b/lib.profiler/src/org/netbeans/lib/profiler/global/CommonConstants.java
index ab4559718..838a335f9 100644
--- a/lib.profiler/src/org/netbeans/lib/profiler/global/CommonConstants.java
+++ b/lib.profiler/src/org/netbeans/lib/profiler/global/CommonConstants.java
@@ -73,6 +73,7 @@
     public static final int JDK_17 = 4; // we treat JDK 17 the same as JDK 1.5 for now
     public static final int JDK_18 = 6;
     public static final int JDK_19 = 7;
+    public static final int JDK_110_BEYOND = 8; //JDK 10 and beyond
     public static final int JDK_CVM = 5;
     public static final int JDK_UNSUPPORTED = -1;
 
@@ -82,6 +83,7 @@
     public static final String JDK_17_STRING = "jdk17"; // NOI18N
     public static final String JDK_18_STRING = "jdk18"; // NOI18N
     public static final String JDK_19_STRING = "jdk19"; // NOI18N
+    public static final String JDK_110_BEYOND_STRING = "jdk110"; // NOI18N
     public static final String JDK_CVM_STRING = "cvm";  // NOI18N
     public static final String JDK_UNSUPPORTED_STRING = "UNSUPPORTED_JDK"; // NOI18N
 
diff --git a/lib.profiler/src/org/netbeans/lib/profiler/global/Platform.java b/lib.profiler/src/org/netbeans/lib/profiler/global/Platform.java
index d9f935fd4..ae9107bcb 100644
--- a/lib.profiler/src/org/netbeans/lib/profiler/global/Platform.java
+++ b/lib.profiler/src/org/netbeans/lib/profiler/global/Platform.java
@@ -158,8 +158,8 @@ public static String getAgentNativeLibFullName(String fullAgentPath, boolean ful
 
         is64bitArch = architecture == ARCH_64;
 
-        if (jdkString.equals(JDK_17_STRING) || jdkString.equals(JDK_18_STRING) || jdkString.equals(JDK_19_STRING)) {
-            // for now, we use the same libs for 1.6 and 1.7 and 1.8 and 1.9
+        if (jdkString.equals(JDK_17_STRING) || jdkString.equals(JDK_18_STRING) || jdkString.equals(JDK_19_STRING) || jdkString.equals(JDK_110_BEYOND_STRING)) {
+            // for now, we use the same libs for 1.6 and beyond
             jdkString = JDK_16_STRING;
         }
 
@@ -286,7 +286,16 @@ private static int getJDKVersionNumber(String javaVersion) {
         } else if (javaVersion.equals("CVM")) { // NOI18N
             jdkVersion = JDK_CVM;
         } else {
-            jdkVersion = JDK_UNSUPPORTED;
+            try {
+                if (Integer.parseInt(javaVersion.replaceAll("[.\\-+].*", "")) >= 10) {
+                    jdkVersion = JDK_110_BEYOND;
+                } else {
+                    jdkVersion = JDK_UNSUPPORTED;
+                }
+            } catch (NumberFormatException ex) {
+                //ignore
+                jdkVersion = JDK_UNSUPPORTED;
+            }
         }
         return jdkVersion;
     }
@@ -316,6 +325,7 @@ public static String getJDKVersionString(String javaVersionString) {
             case JDK_17: return JDK_17_STRING;
             case JDK_18: return JDK_18_STRING;
             case JDK_19: return JDK_19_STRING;
+            case JDK_110_BEYOND: return JDK_110_BEYOND_STRING;
             case JDK_CVM: return JDK_CVM_STRING;
             case JDK_UNSUPPORTED: return JDK_UNSUPPORTED_STRING;
         }
@@ -572,7 +582,8 @@ public static boolean supportsDynamicAttach(String jdkVersionString) {
         return CommonConstants.JDK_16_STRING.equals(jdkVersionString) 
                || CommonConstants.JDK_17_STRING.equals(jdkVersionString)
                || CommonConstants.JDK_18_STRING.equals(jdkVersionString)
-               || CommonConstants.JDK_19_STRING.equals(jdkVersionString);
+               || CommonConstants.JDK_19_STRING.equals(jdkVersionString)
+               || CommonConstants.JDK_110_BEYOND_STRING.equals(jdkVersionString);
     }
 
     /**
@@ -585,6 +596,7 @@ public static boolean supportsThreadSleepingStateMonitoring(String jdkVersionStr
 		   jdkVersionString.equals(JDK_17_STRING) ||
 		   jdkVersionString.equals(JDK_18_STRING) ||
 		   jdkVersionString.equals(JDK_19_STRING) ||
+		   jdkVersionString.equals(JDK_110_BEYOND_STRING) ||
 		   jdkVersionString.equals(JDK_CVM_STRING)));
     }
 
@@ -604,6 +616,7 @@ private static boolean supportsThreadSleepingStateMonitoring(int jdkVersionNumbe
 		(jdkVersionNumber == JDK_17) ||
 		(jdkVersionNumber == JDK_18) ||
 		(jdkVersionNumber == JDK_19) ||
+		(jdkVersionNumber == JDK_110_BEYOND) ||
 		(jdkVersionNumber == JDK_CVM));
     }
 }
diff --git a/lib.profiler/src/org/netbeans/lib/profiler/server/ProfilerInterface.java b/lib.profiler/src/org/netbeans/lib/profiler/server/ProfilerInterface.java
index ffe62e606..1cdc79531 100644
--- a/lib.profiler/src/org/netbeans/lib/profiler/server/ProfilerInterface.java
+++ b/lib.profiler/src/org/netbeans/lib/profiler/server/ProfilerInterface.java
@@ -159,7 +159,7 @@ private void initiateInstrumentation(final int instrType) {
                 e.printStackTrace(System.err);
             }
 
-            if (Platform.getJDKVersionNumber() == CommonConstants.JDK_19) {
+            if (Platform.getJDKVersionNumber() >= CommonConstants.JDK_19) {
                 try {
                     // preload classes for classLoadHook()
                     Class.forName("java.lang.reflect.WeakPairMap$Pair"); // NOI18N
@@ -1458,7 +1458,7 @@ private static void cacheLoadedClasses(Class[] nonSystemClasses, int nonSystemIn
                     }
                 }
             }
-        } else if (status.remoteProfiling || Platform.getJDKVersionNumber() == Platform.JDK_19) {
+        } else if (status.remoteProfiling || Platform.getJDKVersionNumber() >= Platform.JDK_19) {
             classFileBytes = ClassBytesLoader.getClassFileBytes(classURL);
         }
         return classFileBytes;
diff --git a/lib.profiler/src/org/netbeans/lib/profiler/server/ProfilerServer.java b/lib.profiler/src/org/netbeans/lib/profiler/server/ProfilerServer.java
index 724b4a227..e79be1f28 100644
--- a/lib.profiler/src/org/netbeans/lib/profiler/server/ProfilerServer.java
+++ b/lib.profiler/src/org/netbeans/lib/profiler/server/ProfilerServer.java
@@ -617,7 +617,7 @@ public void setRemoteProfiling(boolean remote) {
             ClassBytesLoader.preloadClasses(remote);
         } else {
             System.out.println(LOCAL_SESSION_MSG);
-            if (Platform.getJDKVersionNumber() == JDK_19) {
+            if (Platform.getJDKVersionNumber() >= JDK_19) {
                 // This is to preload some classes that can otherwise be loaded at inappropriate time and cause class load hook firing.
                 ClassBytesLoader.preloadClasses(remote);
             }
diff --git a/lib.profiler/src/org/netbeans/lib/profiler/utils/MiscUtils.java b/lib.profiler/src/org/netbeans/lib/profiler/utils/MiscUtils.java
index 87c90db49..b8277c708 100644
--- a/lib.profiler/src/org/netbeans/lib/profiler/utils/MiscUtils.java
+++ b/lib.profiler/src/org/netbeans/lib/profiler/utils/MiscUtils.java
@@ -296,6 +296,13 @@ public static String getJDKVersionForJVMExeFile(File exeFile)
 
             return JDK_19_STRING;
         } else {
+            try {
+                if (Integer.parseInt(outString.replaceAll("[.\\-+].*", "")) >= 10) {
+                    return JDK_110_BEYOND_STRING;
+                }
+            } catch (NumberFormatException ex) {
+                //ignore
+            }
             throw new IOException(VM_INCOMPATIBLE_MSG + printOutString);
         }
     }
@@ -638,6 +645,14 @@ private static boolean isSupported15or16or17or18or19orCvm(String jdkVersionStrin
             }
         } else if (jdkVersionString.equals("CVM")) {    // NOI18N
             return true;
+        } else {
+            try {
+                if (Integer.parseInt(jdkVersionString.replaceAll("[.\\-+].*", "")) >= 10) {
+                    return true;
+                }
+            } catch (NumberFormatException ex) {
+                //ignore
+            }
         }
         return false;
     }
diff --git a/lib.profiler/test/qa-functional/src/org/netbeans/lib/profiler/tests/jfluid/CommonProfilerTestCase.java b/lib.profiler/test/qa-functional/src/org/netbeans/lib/profiler/tests/jfluid/CommonProfilerTestCase.java
index 4d9dff50c..f6d48a273 100644
--- a/lib.profiler/test/qa-functional/src/org/netbeans/lib/profiler/tests/jfluid/CommonProfilerTestCase.java
+++ b/lib.profiler/test/qa-functional/src/org/netbeans/lib/profiler/tests/jfluid/CommonProfilerTestCase.java
@@ -412,6 +412,14 @@ protected void setTargetVM(ProfilerEngineSettings settings) {
             settings.setTargetJDKVersionString(CommonConstants.JDK_19_STRING);
         } else if (vers.startsWith("9")) {
             settings.setTargetJDKVersionString(CommonConstants.JDK_19_STRING);
+        } else {
+            try {
+                if (Integer.parseInt(vers.replaceAll("[.\\-+].*", "")) >= 10) {
+                    settings.setTargetJDKVersionString(CommonConstants.JDK_110_BEYOND_STRING);
+                }
+            } catch (NumberFormatException ex) {
+                //ignore
+            }
         }
 
         String home = System.getProperty("java.home");
diff --git a/profiler.api/src/org/netbeans/modules/profiler/api/JavaPlatform.java b/profiler.api/src/org/netbeans/modules/profiler/api/JavaPlatform.java
index a319d3fea..ebe38f876 100644
--- a/profiler.api/src/org/netbeans/modules/profiler/api/JavaPlatform.java
+++ b/profiler.api/src/org/netbeans/modules/profiler/api/JavaPlatform.java
@@ -151,6 +151,13 @@ public String getPlatformJDKVersion() {
         } else if (ver.startsWith("9")) {
             return CommonConstants.JDK_19_STRING; // NOI18N
         } else {
+            try {
+                if (Integer.parseInt(ver.replaceAll("[.\\-+].*", "")) >= 10) {
+                    return CommonConstants.JDK_110_BEYOND_STRING;
+                }
+            } catch (NumberFormatException ex) {
+                //ignore
+            }
             return null;
         }
     }
diff --git a/profiler.attach/src/org/netbeans/modules/profiler/attach/providers/TargetPlatformEnum.java b/profiler.attach/src/org/netbeans/modules/profiler/attach/providers/TargetPlatformEnum.java
index 07bebc74d..ba28b53b1 100644
--- a/profiler.attach/src/org/netbeans/modules/profiler/attach/providers/TargetPlatformEnum.java
+++ b/profiler.attach/src/org/netbeans/modules/profiler/attach/providers/TargetPlatformEnum.java
@@ -35,14 +35,16 @@
     private static final String[] jvmNames = new String[] {
                                                  IntegrationUtils.PLATFORM_JAVA_50, IntegrationUtils.PLATFORM_JAVA_60,
                                                  IntegrationUtils.PLATFORM_JAVA_70, IntegrationUtils.PLATFORM_JAVA_80, 
-                                                 IntegrationUtils.PLATFORM_JAVA_90, IntegrationUtils.PLATFORM_JAVA_CVM
+                                                 IntegrationUtils.PLATFORM_JAVA_90, IntegrationUtils.PLATFORM_JAVA_110_BEYOND,
+                                                 IntegrationUtils.PLATFORM_JAVA_CVM
                                              };
     public static final TargetPlatformEnum JDK5 = new TargetPlatformEnum(0);
     public static final TargetPlatformEnum JDK6 = new TargetPlatformEnum(1);
     public static final TargetPlatformEnum JDK7 = new TargetPlatformEnum(2);
     public static final TargetPlatformEnum JDK8 = new TargetPlatformEnum(3);
-    public static final TargetPlatformEnum JDK9 = new TargetPlatformEnum(4);
-    public static final TargetPlatformEnum JDK_CVM = new TargetPlatformEnum(5);
+    public static final TargetPlatformEnum JDK9 = new TargetPlatformEnum(4); //TODO - search!
+    public static final TargetPlatformEnum JDK110_BEYOND = new TargetPlatformEnum(5);
+    public static final TargetPlatformEnum JDK_CVM = new TargetPlatformEnum(6);
 
     //~ Instance fields ----------------------------------------------------------------------------------------------------------
 
@@ -65,12 +67,13 @@ public boolean equals(Object obj) {
     }
 
     public static Iterator iterator() {
-        List jvmList = new ArrayList(6);
+        List jvmList = new ArrayList(7);
         jvmList.add(JDK5);
         jvmList.add(JDK6);
         jvmList.add(JDK7);
         jvmList.add(JDK8);
         jvmList.add(JDK9);
+        jvmList.add(JDK110_BEYOND);
         jvmList.add(JDK_CVM);
 
         return jvmList.listIterator();
diff --git a/profiler.attach/src/org/netbeans/modules/profiler/attach/spi/AbstractRemotePackExporter.java b/profiler.attach/src/org/netbeans/modules/profiler/attach/spi/AbstractRemotePackExporter.java
index c18fe6580..1147eda74 100644
--- a/profiler.attach/src/org/netbeans/modules/profiler/attach/spi/AbstractRemotePackExporter.java
+++ b/profiler.attach/src/org/netbeans/modules/profiler/attach/spi/AbstractRemotePackExporter.java
@@ -52,6 +52,7 @@
             put(TargetPlatformEnum.JDK7.toString(), "15"); //NOI18N
             put(TargetPlatformEnum.JDK8.toString(), "15"); //NOI18N
             put(TargetPlatformEnum.JDK9.toString(), "15"); //NOI18N
+            put(TargetPlatformEnum.JDK110_BEYOND.toString(), "15"); //NOI18N
             put(TargetPlatformEnum.JDK_CVM.toString(), "cvm"); //NOI18N
         }
     };
diff --git a/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/actions/ProfilerLauncher.java b/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/actions/ProfilerLauncher.java
index 3c5cfc0da..37fc1d176 100644
--- a/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/actions/ProfilerLauncher.java
+++ b/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/actions/ProfilerLauncher.java
@@ -532,6 +532,9 @@ private static void setupAgentEnv(JavaPlatform platform, SessionSettings ss, Pro
             } else if (javaVersion.equals(CommonConstants.JDK_19_STRING)) {
                 agentArgs =  IDEUtils.getAntProfilerStartArgument19(ss.getPortNo(), ss.getSystemArchitecture());
                 activateOOMProtection(gps, props, project);
+            } else if (javaVersion.equals(CommonConstants.JDK_110_BEYOND_STRING)) {
+                agentArgs =  IDEUtils.getAntProfilerStartArgument110Beyond(ss.getPortNo(), ss.getSystemArchitecture());
+                activateOOMProtection(gps, props, project);
             } else {
                 throw new IllegalArgumentException("Unsupported JDK " + javaVersion); // NOI18N
             }
diff --git a/profiler/src/org/netbeans/modules/profiler/utils/IDEUtils.java b/profiler/src/org/netbeans/modules/profiler/utils/IDEUtils.java
index 8b5f3d611..4cef208d6 100644
--- a/profiler/src/org/netbeans/modules/profiler/utils/IDEUtils.java
+++ b/profiler/src/org/netbeans/modules/profiler/utils/IDEUtils.java
@@ -69,6 +69,10 @@ public static String getAntProfilerStartArgument19(int port, int architecture) {
         return getAntProfilerStartArgument(port, architecture, CommonConstants.JDK_19_STRING);
     }
 
+    public static String getAntProfilerStartArgument110Beyond(int port, int architecture) {
+        return getAntProfilerStartArgument(port, architecture, CommonConstants.JDK_110_BEYOND_STRING);
+    }
+
 //    // Searches for a localized help. The default directory is <profiler_cluster>/docs/profiler,
 //    // localized help is in <profiler_cluster>/docs/profiler_<locale_suffix> as obtained by NbBundle.getLocalizingSuffixes()
 //    // see Issue 65429 (http://www.netbeans.org/issues/show_bug.cgi?id=65429)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

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