-
Bug
-
Resolution: Fixed
-
P4
-
6, 8, 9, 10
-
b15
-
Not verified
sun.security.provider.PolicyFile$PolicyEntry.toString() throws MissingResourceException because there is NO resource for "SPACE" in sun.security.util.Resources
Exception is thrown when run below code, "java.util.MissingResourceException: Can't find resource for bundle sun.security.util.Resources, key SPACE"
public static void printPolicy() throws Exception {
Policy policy = Policy.getPolicy();
System.out.println("should be PolicyFile: " + policy.getClass().getName());
Class policyFileClass = Policy.getPolicy().getClass();
// private AtomicReference<PolicyInfo> policyInfo = new AtomicReference<>();
Field policyInfoField = policyFileClass.getDeclaredField("policyInfo");
policyInfoField.setAccessible(true);
Object policyInfo = ((AtomicReference)policyInfoField.get(policy)).get();
Class policyInfoClass = policyInfo.getClass();
System.out.println("should be PolicyInfo: " + policyInfoClass.getName());
Field policyEntriesField = policyInfoClass.getDeclaredField("policyEntries");
policyEntriesField.setAccessible(true);
List policyEntries = (List)policyEntriesField.get(policyInfo);
for (Object entry : policyEntries) {
System.out.println("**** PolicyEntry: " + entry);
}
}
Exception is thrown when run below code, "java.util.MissingResourceException: Can't find resource for bundle sun.security.util.Resources, key SPACE"
public static void printPolicy() throws Exception {
Policy policy = Policy.getPolicy();
System.out.println("should be PolicyFile: " + policy.getClass().getName());
Class policyFileClass = Policy.getPolicy().getClass();
// private AtomicReference<PolicyInfo> policyInfo = new AtomicReference<>();
Field policyInfoField = policyFileClass.getDeclaredField("policyInfo");
policyInfoField.setAccessible(true);
Object policyInfo = ((AtomicReference)policyInfoField.get(policy)).get();
Class policyInfoClass = policyInfo.getClass();
System.out.println("should be PolicyInfo: " + policyInfoClass.getName());
Field policyEntriesField = policyInfoClass.getDeclaredField("policyEntries");
policyEntriesField.setAccessible(true);
List policyEntries = (List)policyEntriesField.get(policyInfo);
for (Object entry : policyEntries) {
System.out.println("**** PolicyEntry: " + entry);
}
}
- relates to
-
JDK-8184234 sun.security.provider.AuthPolicyFile$PolicyEntry.toString() throws MissingResourceException
-
- Closed
-