diff options
author | smarks <none@none> | 2011-12-06 10:14:02 -0800 |
---|---|---|
committer | smarks <none@none> | 2011-12-06 10:14:02 -0800 |
commit | be99a5c5f0e14f49568ce10daa3068d1642f9a2e (patch) | |
tree | 9dbd8464c21674c02d51e445d55404f8baa675fe /src/share/classes/java/util/PropertyPermission.java | |
parent | a0541df26c576791d953588811353b9ce28fdb3a (diff) | |
download | jdk8u_jdk-be99a5c5f0e14f49568ce10daa3068d1642f9a2e.tar.gz |
7116997: fix warnings in java.util.PropertyPermission
Reviewed-by: smarks
Contributed-by: Brandon Passanisi <brandon.passanisi@oracle.com>
Diffstat (limited to 'src/share/classes/java/util/PropertyPermission.java')
-rw-r--r-- | src/share/classes/java/util/PropertyPermission.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/share/classes/java/util/PropertyPermission.java b/src/share/classes/java/util/PropertyPermission.java index 026ce9be0e..1773188359 100644 --- a/src/share/classes/java/util/PropertyPermission.java +++ b/src/share/classes/java/util/PropertyPermission.java @@ -305,7 +305,7 @@ public final class PropertyPermission extends BasicPermission { switch(a[i-matchlen]) { case ',': seencomma = true; - /*FALLTHROUGH*/ + break; case ' ': case '\r': case '\n': case '\f': case '\t': break; @@ -442,7 +442,7 @@ implements Serializable * Key is property name; value is PropertyPermission. * Not serialized; see serialization section at end of class. */ - private transient Map perms; + private transient Map<String, Permission> perms; /** * Boolean saying if "*" is in the collection. @@ -458,7 +458,7 @@ implements Serializable */ public PropertyPermissionCollection() { - perms = new HashMap(32); // Capacity for default policy + perms = new HashMap<>(32); // Capacity for default policy all_allowed = false; } @@ -593,7 +593,7 @@ implements Serializable * @return an enumeration of all the PropertyPermission objects. */ - public Enumeration elements() { + public Enumeration<Permission> elements() { // Convert Iterator of Map values into an Enumeration synchronized (this) { return Collections.enumeration(perms.values()); @@ -633,7 +633,7 @@ implements Serializable // Don't call out.defaultWriteObject() // Copy perms into a Hashtable - Hashtable permissions = new Hashtable(perms.size()*2); + Hashtable<String, Permission> permissions = new Hashtable<>(perms.size()*2); synchronized (this) { permissions.putAll(perms); } @@ -660,8 +660,10 @@ implements Serializable all_allowed = gfields.get("all_allowed", false); // Get permissions - Hashtable permissions = (Hashtable)gfields.get("permissions", null); - perms = new HashMap(permissions.size()*2); + @SuppressWarnings("unchecked") + Hashtable<String, Permission> permissions = + (Hashtable<String, Permission>)gfields.get("permissions", null); + perms = new HashMap<>(permissions.size()*2); perms.putAll(permissions); } } |