classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch: BasicPermission constructor


From: Andrew Haley
Subject: Patch: BasicPermission constructor
Date: Wed, 4 Aug 2004 18:01:27 +0100

2004-08-04  Andrew Haley  <address@hidden>

        * java/security/BasicPermission.java: Don't check wildcards.

Index: BasicPermission.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/security/BasicPermission.java,v
retrieving revision 1.6
diff -u -r1.6 BasicPermission.java
--- BasicPermission.java        14 Jun 2003 05:45:12 -0000      1.6
+++ BasicPermission.java        4 Aug 2004 16:58:01 -0000
@@ -80,9 +80,8 @@
   private static final long serialVersionUID = 6279438298436773498L;
 
   /**
-   * Create a new instance with the specified permission name. If the name
-   * is empty, or contains an illegal wildcard character, an exception is
-   * thrown.
+   * Create a new instance with the specified permission name. If the
+   * name is empty an exception is thrown.
    *
    * @param name the name of this permission
    * @throws NullPointerException if name is null
@@ -91,12 +90,11 @@
   public BasicPermission(String name)
   {
     super(name);
-    if (name.indexOf("*") != -1)
-      {
-        if ((! name.endsWith(".*") && ! name.equals("*"))
-            || name.indexOf("*") != name.lastIndexOf("*"))
-          throw new IllegalArgumentException("Bad wildcard: " + name);
-      }
+
+    // This routine used to check for illegal wildcards, but no such
+    // requirement exists in the specification and Sun's runtime
+    // doesn't appear to do it.
+
     if ("".equals(name))
       throw new IllegalArgumentException("Empty name");
   }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]