changeset 2322:78d91c4223cb

6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7 Reviewed-by: mullan
author vinnie
date Mon, 01 Mar 2010 17:54:31 +0000
parents 9929203a8b98
children 893034df4ec2
files src/share/classes/java/security/IdentityScope.java src/share/lib/security/java.security test/java/security/IdentityScope/NoDefaultSystemScope.java
diffstat 3 files changed, 44 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/security/IdentityScope.java	Thu Feb 25 13:32:40 2010 +0800
+++ b/src/share/classes/java/security/IdentityScope.java	Mon Mar 01 17:54:31 2010 +0000
@@ -129,7 +129,8 @@
     /**
      * Returns the system's identity scope.
      *
-     * @return the system's identity scope.
+     * @return the system's identity scope, or {@code null} if none has been
+     *         set.
      *
      * @see #setSystemScope
      */
--- a/src/share/lib/security/java.security	Thu Feb 25 13:32:40 2010 +0800
+++ b/src/share/lib/security/java.security	Mon Mar 01 17:54:31 2010 +0000
@@ -118,11 +118,6 @@
 keystore.type=jks
 
 #
-# Class to instantiate as the system scope:
-#
-system.scope=sun.security.provider.IdentityDatabase
-
-#
 # List of comma-separated packages that start with or equal this string
 # will cause a security exception to be thrown when
 # passed to checkPackageAccess unless the
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/security/IdentityScope/NoDefaultSystemScope.java	Mon Mar 01 17:54:31 2010 +0000
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6921001
+ * @summary The default system identity scope is now null.
+ */
+import java.security.*;
+
+public class NoDefaultSystemScope {
+
+    public static void main(String args[]) throws Exception {
+        IdentityScope s = IdentityScope.getSystemScope();
+
+        if (s != null) {
+            throw new Exception("The default system scope should be null");
+        }
+        System.out.println("TEST PASSED");
+    }
+}
+