Skip to content

Commit

Permalink
proposed method isSecurityManagerSupported()
Browse files Browse the repository at this point in the history
  • Loading branch information
Tibor17 committed Jan 1, 2022
1 parent 2777153 commit b44d7d0
Showing 1 changed file with 15 additions and 1 deletion.
Expand Up @@ -22,8 +22,11 @@
import java.lang.management.ManagementFactory;
import java.util.Map;

import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_16;
import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_RECENT;

/**
* Similar to Java 7 java.util.Objects.
* Similar to Java 7 java.util.Objects, and another utility methods.
*
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.20
Expand All @@ -44,4 +47,15 @@ public static Map<String, String> systemProps()
{
return ManagementFactory.getRuntimeMXBean().getSystemProperties();
}

/**
* The {@link SecurityManager} is deprecated since Java 17.
*
* @return <code>true</code> if Java Specification Version is less than
* or equal to 16; <code>false</code> otherwise.
*/
public static boolean isSecurityManagerSupported()
{
return JAVA_RECENT.atMost( JAVA_16 );
}
}

0 comments on commit b44d7d0

Please sign in to comment.