Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/com/sun/rmi/rmid/ExecPermission.java
          +++ new/src/share/classes/com/sun/rmi/rmid/ExecPermission.java
↓ open down ↓ 219 lines elided ↑ open up ↑
 220  220       * must be stored in a manner that allows them to be inserted in any
 221  221       * order, but enable the implies function to evaluate the implies
 222  222       * method in an efficient (and consistent) manner.
 223  223       *
 224  224       * @serial include
 225  225       */
 226  226      private static class ExecPermissionCollection
 227  227          extends PermissionCollection
 228  228          implements java.io.Serializable
 229  229      {
 230      -        private Vector permissions;
      230 +        private Vector<Permission> permissions;
 231  231  
 232  232          private static final long serialVersionUID = -3352558508888368273L;
 233  233  
 234  234          /**
 235  235           * Create an empty ExecPermissionCollection.
 236  236           */
 237  237          public ExecPermissionCollection() {
 238      -            permissions = new Vector();
      238 +            permissions = new Vector<Permission>();
 239  239          }
 240  240  
 241  241          /**
 242  242           * Adds a permission to the collection.
 243  243           *
 244  244           * @param permission the Permission object to add.
 245  245           *
 246  246           * @exception IllegalArgumentException - if the permission is not a
 247  247           *                                       ExecPermission
 248  248           *
↓ open down ↓ 18 lines elided ↑ open up ↑
 267  267           * @param p the Permission object to compare
 268  268           *
 269  269           * @return true if "permission" is a proper subset of a permission in
 270  270           * the set, false if not.
 271  271           */
 272  272          public boolean implies(Permission permission)
 273  273          {
 274  274              if (! (permission instanceof ExecPermission))
 275  275                  return false;
 276  276  
 277      -            Enumeration e = permissions.elements();
      277 +            Enumeration<Permission> e = permissions.elements();
 278  278  
 279  279              while (e.hasMoreElements()) {
 280      -                ExecPermission x = (ExecPermission) e.nextElement();
      280 +                ExecPermission x = (ExecPermission)e.nextElement();
 281  281                  if (x.implies(permission)) {
 282  282                      return true;
 283  283                  }
 284  284              }
 285  285              return false;
 286  286          }
 287  287  
 288  288          /**
 289  289           * Returns an enumeration of all the ExecPermission objects in the
 290  290           * container.
 291  291           *
 292  292           * @return an enumeration of all the ExecPermission objects.
 293  293           */
 294      -        public Enumeration elements()
      294 +        public Enumeration<Permission> elements()
 295  295          {
 296  296              return permissions.elements();
 297  297          }
 298  298      }
 299  299  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX