You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by ge...@apache.org on 2018/04/02 21:11:44 UTC

[incubator-netbeans] branch master updated: [NETBEANS-539] Attempting to add support for JDK 10 and beyond to profiler, by using codepaths for JDK 9. (#473)

This is an automated email from the ASF dual-hosted git repository.

geertjan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 21786f9  [NETBEANS-539] Attempting to add support for JDK 10 and beyond to profiler, by using codepaths for JDK 9. (#473)
21786f9 is described below

commit 21786f9c6485b9a1fe175758e618f4e7c1d077a3
Author: Jan Lahoda <la...@gmail.com>
AuthorDate: Mon Apr 2 23:11:42 2018 +0200

    [NETBEANS-539] Attempting to add support for JDK 10 and beyond to profiler, by using codepaths for JDK 9. (#473)
---
 .../profiler/common/integration/Bundle.properties   |  2 ++
 .../common/integration/IntegrationUtils.java        | 14 +++++++++++---
 .../org/netbeans/lib/profiler/ProfilerClient.java   |  2 +-
 .../org/netbeans/lib/profiler/TargetAppRunner.java  | 11 +++++++----
 .../lib/profiler/global/CalibrationDataFileIO.java  |  3 ++-
 .../lib/profiler/global/CommonConstants.java        |  2 ++
 .../org/netbeans/lib/profiler/global/Platform.java  | 21 +++++++++++++++++----
 .../lib/profiler/server/ProfilerInterface.java      |  4 ++--
 .../lib/profiler/server/ProfilerServer.java         |  2 +-
 .../org/netbeans/lib/profiler/utils/MiscUtils.java  | 15 +++++++++++++++
 .../tests/jfluid/CommonProfilerTestCase.java        |  8 ++++++++
 .../netbeans/modules/profiler/api/JavaPlatform.java |  7 +++++++
 .../attach/providers/TargetPlatformEnum.java        | 11 +++++++----
 .../attach/spi/AbstractRemotePackExporter.java      |  1 +
 .../profiler/nbimpl/actions/ProfilerLauncher.java   |  3 +++
 .../netbeans/modules/profiler/utils/IDEUtils.java   |  4 ++++
 16 files changed, 90 insertions(+), 20 deletions(-)

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 f43d1f5..149c3c9 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 42ac042..358c586 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 class IntegrationUtils {
     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 @@ public class IntegrationUtils {
     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 class IntegrationUtils {
             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 class IntegrationUtils {
             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 class IntegrationUtils {
             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 class IntegrationUtils {
     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 class IntegrationUtils {
                                                                       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 class IntegrationUtils {
                                                                       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 4d18f01..4d31ac8 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 @@ public class ProfilerClient implements CommonConstants {
         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 ae12d2c..2239a14 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 class TargetAppRunner implements CommonConstants {
         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 @@ public class TargetAppRunner implements CommonConstants {
         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 @@ public class TargetAppRunner implements CommonConstants {
                 || 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 f2d494c..b2b07da 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 class CalibrationDataFileIO {
                     || 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 ab45597..838a335 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 interface CommonConstants {
     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 interface CommonConstants {
     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 d9f935f..ae9107b 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 class Platform implements CommonConstants {
 
         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 @@ public class Platform implements CommonConstants {
         } 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 class Platform implements CommonConstants {
             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 class Platform implements CommonConstants {
         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 class Platform implements CommonConstants {
 		   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 @@ public class Platform implements CommonConstants {
 		(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 ffe62e6..1cdc795 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 @@ public class ProfilerInterface implements CommonConstants {
                 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 @@ public class ProfilerInterface implements CommonConstants {
                     }
                 }
             }
-        } 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 724b4a2..e79be1f 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 class ProfilerServer extends Thread implements CommonConstants {
             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 87c90db..b8277c7 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 class MiscUtils implements CommonConstants {
 
             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 @@ public class MiscUtils implements CommonConstants {
             }
         } 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 4d9dff5..f6d48a2 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 @@ public abstract class CommonProfilerTestCase extends NbTestCase {
             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 a319d3f..ebe38f8 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 final class JavaPlatform {
         } 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 07bebc7..ba28b53 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 @@ public class TargetPlatformEnum {
     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 class TargetPlatformEnum {
     }
 
     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 c18fe65..1147eda 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 @@ abstract public class AbstractRemotePackExporter {
             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 3c5cfc0..37fc1d1 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 @@ public class ProfilerLauncher {
             } 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 8b5f3d6..4cef208 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 final class IDEUtils {
         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)

-- 
To stop receiving notification emails like this one, please contact
geertjan@apache.org.

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

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