8211860: Avoid reading security properties eagerly on Manifest class initialization

Reviewed-by: mullan, alanb
This commit is contained in:
Claes Redestad 2018-10-08 18:16:03 +02:00
parent 8791ea8dc0
commit d5d74f0e26
2 changed files with 5 additions and 5 deletions

View File

@ -49,9 +49,6 @@ import sun.security.util.SecurityProperties;
*/
public class Manifest implements Cloneable {
private static final boolean jarInfoInExceptionText =
SecurityProperties.includedInExceptions("jar");
// manifest main attributes
private Attributes attr = new Attributes();
@ -203,10 +200,10 @@ public class Manifest implements Cloneable {
}
static String getErrorPosition(String filename, final int lineNumber) {
if (filename == null || !jarInfoInExceptionText) {
if (filename == null ||
!SecurityProperties.INCLUDE_JAR_NAME_IN_EXCEPTIONS) {
return "line " + lineNumber;
}
return "manifest of " + filename + ":" + lineNumber;
}

View File

@ -32,6 +32,9 @@ import java.security.Security;
public class SecurityProperties {
public static final boolean INCLUDE_JAR_NAME_IN_EXCEPTIONS
= includedInExceptions("jar");
/**
* Returns the value of the security property propName, which can be overridden
* by a system property of the same name