src/share/classes/java/util/PropertyPermission.java

Print this page

        

@@ -128,14 +128,11 @@
      * Also called during de-serialization.
      *
      * @param mask the actions mask to use.
      *
      */
-
-    private void init(int mask)
-    {
-
+    private void init(int mask) {
         if ((mask & ALL) != mask)
                 throw new IllegalArgumentException("invalid actions mask");
 
         if (mask == NONE)
                 throw new IllegalArgumentException("invalid actions mask");

@@ -158,13 +155,11 @@
      *
      * @throws NullPointerException if <code>name</code> is <code>null</code>.
      * @throws IllegalArgumentException if <code>name</code> is empty or if
      * <code>actions</code> is invalid.
      */
-
-    public PropertyPermission(String name, String actions)
-    {
+    public PropertyPermission(String name, String actions) {
         super(name,actions);
         init(getMask(actions));
     }
 
     /**

@@ -194,11 +189,10 @@
         // They must be equal to that.mask for implies to return true.
 
         return ((this.mask & that.mask) == that.mask) && super.implies(that);
     }
 
-
     /**
      * Checks two PropertyPermission objects for equality. Checks that <i>obj</i> is
      * a PropertyPermission, and has the same name and actions as this object.
      * <P>
      * @param obj the object we are testing for equality with this object.

@@ -224,20 +218,18 @@
      * <code>getName().hashCode()</code>, where <code>getName</code> is
      * from the Permission superclass.
      *
      * @return a hash code value for this object.
      */
-
     public int hashCode() {
         return this.getName().hashCode();
     }
 
-
     /**
      * Converts an actions String to an actions mask.
      *
-     * @param action the action string.
+     * @param actions the action string.
      * @return the actions mask.
      */
     private static int getMask(String actions) {
 
         int mask = NONE;

@@ -330,12 +322,11 @@
      * Always returns present actions in the following order:
      * read, write.
      *
      * @return the canonical string representation of the actions.
      */
-    static String getActions(int mask)
-    {
+    static String getActions(int mask) {
         StringBuilder sb = new StringBuilder();
         boolean comma = false;
 
         if ((mask & READ) == READ) {
             comma = true;

@@ -357,12 +348,11 @@
      * allows both write and read actions, a call to <code>getActions</code>
      * will return the string "read,write".
      *
      * @return the canonical string representation of the actions.
      */
-    public String getActions()
-    {
+    public String getActions() {
         if (actions == null)
             actions = getActions(this.mask);
 
         return actions;
     }

@@ -371,11 +361,10 @@
      * Return the current action mask.
      * Used by the PropertyPermissionCollection
      *
      * @return the actions mask.
      */
-
     int getMask() {
         return mask;
     }
 
     /**

@@ -384,11 +373,10 @@
      * <p>
      *
      * @return a new PermissionCollection object suitable for storing
      * PropertyPermissions.
      */
-
     public PermissionCollection newPermissionCollection() {
         return new PropertyPermissionCollection();
     }
 
 

@@ -434,11 +422,11 @@
  * @author Roland Schemers
  *
  * @serial include
  */
 final class PropertyPermissionCollection extends PermissionCollection
-implements Serializable
+    implements Serializable
 {
 
     /**
      * Key is property name; value is PropertyPermission.
      * Not serialized; see serialization section at end of class.

@@ -452,14 +440,12 @@
      */
     // No sync access; OK for this to be stale.
     private boolean all_allowed;
 
     /**
-     * Create an empty PropertyPermissions object.
-     *
+     * Create an empty PropertyPermissionCollection object.
      */
-
     public PropertyPermissionCollection() {
         perms = new HashMap<>(32);     // Capacity for default policy
         all_allowed = false;
     }
 

@@ -473,13 +459,11 @@
      *                                       PropertyPermission
      *
      * @exception SecurityException - if this PropertyPermissionCollection
      *                                object has been marked readonly
      */
-
-    public void add(Permission permission)
-    {
+    public void add(Permission permission) {
         if (! (permission instanceof PropertyPermission))
             throw new IllegalArgumentException("invalid permission: "+
                                                permission);
         if (isReadOnly())
             throw new SecurityException(

@@ -512,18 +496,16 @@
 
     /**
      * Check and see if this set of permissions implies the permissions
      * expressed in "permission".
      *
-     * @param p the Permission object to compare
+     * @param permission the Permission object to compare
      *
      * @return true if "permission" is a proper subset of a permission in
      * the set, false if not.
      */
-
-    public boolean implies(Permission permission)
-    {
+    public boolean implies(Permission permission) {
         if (! (permission instanceof PropertyPermission))
                 return false;
 
         PropertyPermission pp = (PropertyPermission) permission;
         PropertyPermission x;

@@ -653,12 +635,13 @@
 
     /*
      * Reads in a Hashtable of PropertyPermissions and saves them in the
      * perms field. Reads in all_allowed.
      */
-    private void readObject(ObjectInputStream in) throws IOException,
-    ClassNotFoundException {
+    private void readObject(ObjectInputStream in)
+        throws IOException, ClassNotFoundException
+    {
         // Don't call defaultReadObject()
 
         // Read in serialized fields
         ObjectInputStream.GetField gfields = in.readFields();