/[classpath]/classpath/java/security/BasicPermission.java
ViewVC logotype

Diff of /classpath/java/security/BasicPermission.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by mark, Fri Jul 18 16:54:56 2003 UTC revision 1.11 by mkoch, Fri Sep 24 13:35:16 2004 UTC
# Line 81  public abstract class BasicPermission ex Line 81  public abstract class BasicPermission ex
81    private static final long serialVersionUID = 6279438298436773498L;    private static final long serialVersionUID = 6279438298436773498L;
82    
83    /**    /**
84     * Create a new instance with the specified permission name. If the name     * Create a new instance with the specified permission name. If the
85     * is empty, or contains an illegal wildcard character, an exception is     * name is empty an exception is thrown.
    * thrown.  
86     *     *
87     * @param name the name of this permission     * @param name the name of this permission
88     * @throws NullPointerException if name is null     * @throws NullPointerException if name is null
# Line 92  public abstract class BasicPermission ex Line 91  public abstract class BasicPermission ex
91    public BasicPermission(String name)    public BasicPermission(String name)
92    {    {
93      super(name);      super(name);
94      if (name.indexOf("*") != -1)  
95        {      // This routine used to check for illegal wildcards, but no such
96          if ((! name.endsWith(".*") && ! name.equals("*"))      // requirement exists in the specification and Sun's runtime
97              || name.indexOf("*") != name.lastIndexOf("*"))      // doesn't appear to do it.
98            throw new IllegalArgumentException("Bad wildcard: " + name);  
       }  
99      if ("".equals(name))      if ("".equals(name))
100        throw new IllegalArgumentException("Empty name");        throw new IllegalArgumentException("Empty name");
101    }    }

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26