You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/01/01 13:48:36 UTC

[GitHub] [maven-surefire] Tibor17 commented on a change in pull request #422: [SUREFIRE-1975] JDK18 - The Security Manager is deprecated and will be removed in a future release

Tibor17 commented on a change in pull request #422:
URL: https://github.com/apache/maven-surefire/pull/422#discussion_r777110752



##########
File path: surefire-api/src/main/java/org/apache/maven/surefire/api/util/internal/ObjectUtils.java
##########
@@ -44,4 +46,11 @@ private ObjectUtils()
     {
         return ManagementFactory.getRuntimeMXBean().getSystemProperties();
     }
+
+    public static boolean isSecurityManagerSupported()
+    {
+        ClassLoader classLoader = ObjectUtils.class.getClassLoader();
+        Class<?> smClass = tryLoadClass( classLoader, "java.lang.SecurityManager" );
+        return smClass != null && !smClass.isAnnotationPresent( Deprecated.class );
+    }

Review comment:
       It was my previous solution but the class appears in module surefire-booter. This is surefire-api, so we cannot inherit it and cannot duplicate the code.




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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org