< prev index next >

test/jdk/java/util/logging/Logger/setResourceBundle/TestSetResourceBundle.java

Print this page
rev 47439 : 8189291: Test policy should extend the default system policy
Reviewed-by:

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -37,20 +37,21 @@
 import java.util.logging.LoggingPermission;
 import resources.ListBundle;
 
 /**
  * @test
- * @bug 8013839
+ * @bug 8013839 8189291
  * @summary tests Logger.setResourceBundle;
  * @build TestSetResourceBundle resources.ListBundle resources.ListBundle_fr
  * @run main/othervm TestSetResourceBundle UNSECURE
  * @run main/othervm TestSetResourceBundle PERMISSION
  * @run main/othervm TestSetResourceBundle SECURE
  * @author danielfuchs
  */
 public class TestSetResourceBundle {
 
+    static final Policy DEFAULT_POLICY = Policy.getPolicy();
     static final String LIST_BUNDLE_NAME = "resources.ListBundle";
     static final String PROPERTY_BUNDLE_NAME = "resources.PropertyBundle";
 
     /**
      * A dummy handler class that we can use to check the bundle/bundle name

@@ -477,10 +478,11 @@
             permissions.add(new PropertyPermission("user.language", "write"));
         }
 
         @Override
         public boolean implies(ProtectionDomain domain, Permission permission) {
-            return permissions.implies(permission);
+            return permissions.implies(permission) ||
+                   DEFAULT_POLICY.implies(domain, permission);
         }
     }
 
 }
< prev index next >