diff options
author | Eric Blake <ebb9@byu.net> | 2002-03-06 19:44:44 +0000 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2002-03-06 19:44:44 +0000 |
commit | 17c3f9b21a1503325cafd893332decf6c003a916 (patch) | |
tree | b76fe7e6ed37726c5687bb3d2eacd444561c61e5 /java/util/PropertyPermission.java | |
parent | e2c44b08d79dbbbb6ddd4d1544a90d4d1cc5f8d2 (diff) | |
download | classpath-17c3f9b21a1503325cafd893332decf6c003a916.tar.gz |
2002-03-06 Eric Blake <ebb9@email.byu.edu>
* java/lang/RuntimePermission.java: Improve Javadoc.
* java/lang/SecurityManager.java: Improve Javadoc and formatting.
* java/lang/System.java (setIn, setOut, setErr): Add required
security check.
(defaultProperties): Add a default, to allow clean resetting of
properties back to the VM startup state.
(setProperties): Correctly reset properties to default state.
* native/jni/java-lang/java_lang_System.c: Update method
signatures for changing I/O.
* include/java_lang_System.h: Ditto.
* vm/reference/java/lang/Runtime.java: Add shutdown hook
capability, as well as updating the exec calls.
* vm/reference/java/lang/VMSecurityManager.java: Improve Javadoc.
* java/util/PropertyPermission.java: Fix implication bugs.
* java/util/PropertyPermissionCollection.java: Ditto.
Diffstat (limited to 'java/util/PropertyPermission.java')
-rw-r--r-- | java/util/PropertyPermission.java | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/java/util/PropertyPermission.java b/java/util/PropertyPermission.java index 8a87c1301..bb03e45f3 100644 --- a/java/util/PropertyPermission.java +++ b/java/util/PropertyPermission.java @@ -111,6 +111,7 @@ public final class PropertyPermission extends BasicPermission * * @param name the name of the property * @param actions the action string + * @throws NullPointerException if name is null * @throws IllegalArgumentException if name string contains an * illegal wildcard or actions string contains an illegal action * (this includes a null actions string) @@ -187,16 +188,14 @@ public final class PropertyPermission extends BasicPermission */ public boolean implies(Permission p) { - if (! (p instanceof PropertyPermission)) - return false; - - // We have to check the actions. - PropertyPermission pp = (PropertyPermission) p; - if ((pp.actions & ~actions) != 0) - return false; - - // BasicPermission checks for name. - return super.implies(p); + // BasicPermission checks for name and type. + if (super.implies(p)) + { + // We have to check the actions. + PropertyPermission pp = (PropertyPermission) p; + return (pp.actions & ~actions) == 0; + } + return false; } /** @@ -209,10 +208,7 @@ public final class PropertyPermission extends BasicPermission */ public boolean equals(Object obj) { - if (! (obj instanceof PropertyPermission)) - return false; - PropertyPermission p = (PropertyPermission) obj; - return actions == p.actions && super.equals(p); + return super.equals(obj) && actions == ((PropertyPermission) obj).actions; } /** |