7116997: fix warnings in java.util.PropertyPermission
Reviewed-by: smarks
This commit is contained in:
parent
272537ad66
commit
c7a1eec197
@ -305,7 +305,7 @@ public final class PropertyPermission extends BasicPermission {
|
|||||||
switch(a[i-matchlen]) {
|
switch(a[i-matchlen]) {
|
||||||
case ',':
|
case ',':
|
||||||
seencomma = true;
|
seencomma = true;
|
||||||
/*FALLTHROUGH*/
|
break;
|
||||||
case ' ': case '\r': case '\n':
|
case ' ': case '\r': case '\n':
|
||||||
case '\f': case '\t':
|
case '\f': case '\t':
|
||||||
break;
|
break;
|
||||||
@ -442,7 +442,7 @@ implements Serializable
|
|||||||
* Key is property name; value is PropertyPermission.
|
* Key is property name; value is PropertyPermission.
|
||||||
* Not serialized; see serialization section at end of class.
|
* 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.
|
* Boolean saying if "*" is in the collection.
|
||||||
@ -458,7 +458,7 @@ implements Serializable
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public PropertyPermissionCollection() {
|
public PropertyPermissionCollection() {
|
||||||
perms = new HashMap(32); // Capacity for default policy
|
perms = new HashMap<>(32); // Capacity for default policy
|
||||||
all_allowed = false;
|
all_allowed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -593,7 +593,7 @@ implements Serializable
|
|||||||
* @return an enumeration of all the PropertyPermission objects.
|
* @return an enumeration of all the PropertyPermission objects.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public Enumeration elements() {
|
public Enumeration<Permission> elements() {
|
||||||
// Convert Iterator of Map values into an Enumeration
|
// Convert Iterator of Map values into an Enumeration
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
return Collections.enumeration(perms.values());
|
return Collections.enumeration(perms.values());
|
||||||
@ -633,7 +633,7 @@ implements Serializable
|
|||||||
// Don't call out.defaultWriteObject()
|
// Don't call out.defaultWriteObject()
|
||||||
|
|
||||||
// Copy perms into a Hashtable
|
// Copy perms into a Hashtable
|
||||||
Hashtable permissions = new Hashtable(perms.size()*2);
|
Hashtable<String, Permission> permissions = new Hashtable<>(perms.size()*2);
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
permissions.putAll(perms);
|
permissions.putAll(perms);
|
||||||
}
|
}
|
||||||
@ -660,8 +660,10 @@ implements Serializable
|
|||||||
all_allowed = gfields.get("all_allowed", false);
|
all_allowed = gfields.get("all_allowed", false);
|
||||||
|
|
||||||
// Get permissions
|
// Get permissions
|
||||||
Hashtable permissions = (Hashtable)gfields.get("permissions", null);
|
@SuppressWarnings("unchecked")
|
||||||
perms = new HashMap(permissions.size()*2);
|
Hashtable<String, Permission> permissions =
|
||||||
|
(Hashtable<String, Permission>)gfields.get("permissions", null);
|
||||||
|
perms = new HashMap<>(permissions.size()*2);
|
||||||
perms.putAll(permissions);
|
perms.putAll(permissions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user