src/share/classes/com/sun/rmi/rmid/ExecOptionPermission.java

Print this page

        

@@ -221,19 +221,19 @@
     private static class ExecOptionPermissionCollection
         extends PermissionCollection
         implements java.io.Serializable
     {
 
-        private Hashtable permissions;
+        private Hashtable<String, Permission> permissions;
         private boolean all_allowed; // true if "*" is in the collection
         private static final long serialVersionUID = -1242475729790124375L;
 
         /**
          * Create an empty ExecOptionPermissionCollection.
          */
         public ExecOptionPermissionCollection() {
-            permissions = new Hashtable(11);
+            permissions = new Hashtable<String, Permission>(11);
             all_allowed = false;
         }
 
         /**
          * Adds a permission to the collection. The key for the hash is

@@ -289,11 +289,11 @@
             // Check for full match first. Then work our way up the
             // name looking for matches on a.b.*
 
             String pname = p.getName();
 
-            Permission x = (Permission) permissions.get(pname);
+            Permission x = permissions.get(pname);
 
             if (x != null)
                 // we have a direct hit!
                 return x.implies(permission);
 

@@ -304,11 +304,11 @@
             offset = pname.length() - 1;
 
             while ((last = pname.lastIndexOf(".", offset)) != -1) {
 
                 pname = pname.substring(0, last+1) + "*";
-                x = (Permission) permissions.get(pname);
+                x = permissions.get(pname);
 
                 if (x != null) {
                     return x.implies(permission);
                 }
                 offset = last - 1;

@@ -319,11 +319,11 @@
             offset = pname.length() - 1;
 
             while ((last = pname.lastIndexOf("=", offset)) != -1) {
 
                 pname = pname.substring(0, last+1) + "*";
-                x = (Permission) permissions.get(pname);
+                x = permissions.get(pname);
 
                 if (x != null) {
                     return x.implies(permission);
                 }
                 offset = last - 1;

@@ -339,11 +339,11 @@
          * container.
          *
          * @return an enumeration of all the ExecOptionPermission objects.
          */
 
-        public Enumeration elements()
+        public Enumeration<Permission> elements()
         {
             return permissions.elements();
         }
     }
 }