--- old/src/share/classes/java/util/PropertyPermission.java Mon Oct 1 10:51:50 2012
+++ new/src/share/classes/java/util/PropertyPermission.java Mon Oct 1 10:51:49 2012
@@ -130,18 +130,15 @@
* @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");
+ throw new IllegalArgumentException("invalid actions mask");
if (mask == NONE)
- throw new IllegalArgumentException("invalid actions mask");
+ throw new IllegalArgumentException("invalid actions mask");
if (getName() == null)
- throw new NullPointerException("name can't be null");
+ throw new NullPointerException("name can't be null");
this.mask = mask;
}
@@ -160,9 +157,7 @@
* @throws IllegalArgumentException if name
is empty or if
* actions
is invalid.
*/
-
- public PropertyPermission(String name, String actions)
- {
+ public PropertyPermission(String name, String actions) {
super(name,actions);
init(getMask(actions));
}
@@ -196,7 +191,6 @@
return ((this.mask & that.mask) == that.mask) && super.implies(that);
}
-
/**
* Checks two PropertyPermission objects for equality. Checks that obj is
* a PropertyPermission, and has the same name and actions as this object.
@@ -226,16 +220,14 @@
*
* @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) {
@@ -332,8 +324,7 @@
*
* @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;
@@ -359,8 +350,7 @@
*
* @return the canonical string representation of the actions.
*/
- public String getActions()
- {
+ public String getActions() {
if (actions == null)
actions = getActions(this.mask);
@@ -373,7 +363,6 @@
*
* @return the actions mask.
*/
-
int getMask() {
return mask;
}
@@ -386,7 +375,6 @@
* @return a new PermissionCollection object suitable for storing
* PropertyPermissions.
*/
-
public PermissionCollection newPermissionCollection() {
return new PropertyPermissionCollection();
}
@@ -436,7 +424,7 @@
* @serial include
*/
final class PropertyPermissionCollection extends PermissionCollection
-implements Serializable
+ implements Serializable
{
/**
@@ -454,10 +442,8 @@
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;
@@ -475,9 +461,7 @@
* @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);
@@ -514,14 +498,12 @@
* 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;
@@ -655,8 +637,9 @@
* 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