Commit 26be638d by Andrew Haley Committed by Andrew Haley

BasicPermission.java: Don't check wildcards.

2004-08-04  Andrew Haley  <aph@redhat.com>

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

From-SVN: r85608
parent d279700a
2004-08-04 Andrew Haley <aph@redhat.com>
* java/security/BasicPermission.java: Don't check wildcards.
2004-08-04 Thomas Fitzsimmons <fitzsim@redhat.com> 2004-08-04 Thomas Fitzsimmons <fitzsim@redhat.com>
Michael Koch <konqueror@gmx.de> Michael Koch <konqueror@gmx.de>
......
...@@ -80,9 +80,8 @@ public abstract class BasicPermission extends Permission ...@@ -80,9 +80,8 @@ public abstract class BasicPermission extends Permission
private static final long serialVersionUID = 6279438298436773498L; private static final long serialVersionUID = 6279438298436773498L;
/** /**
* Create a new instance with the specified permission name. If the name * Create a new instance with the specified permission name. If the
* is empty, or contains an illegal wildcard character, an exception is * name is empty an exception is thrown.
* thrown.
* *
* @param name the name of this permission * @param name the name of this permission
* @throws NullPointerException if name is null * @throws NullPointerException if name is null
...@@ -91,12 +90,11 @@ public abstract class BasicPermission extends Permission ...@@ -91,12 +90,11 @@ public abstract class BasicPermission extends Permission
public BasicPermission(String name) public BasicPermission(String name)
{ {
super(name); super(name);
if (name.indexOf("*") != -1)
{ // This routine used to check for illegal wildcards, but no such
if ((! name.endsWith(".*") && ! name.equals("*")) // requirement exists in the specification and Sun's runtime
|| name.indexOf("*") != name.lastIndexOf("*")) // doesn't appear to do it.
throw new IllegalArgumentException("Bad wildcard: " + name);
}
if ("".equals(name)) if ("".equals(name))
throw new IllegalArgumentException("Empty name"); throw new IllegalArgumentException("Empty name");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment