--- old/src/share/classes/java/io/FilePermission.java Mon Oct 1 10:50:03 2012 +++ new/src/share/classes/java/io/FilePermission.java Mon Oct 1 10:50:02 2012 @@ -76,7 +76,7 @@ *

* Be careful when granting FilePermissions. Think about the implications * of granting read and especially write access to various files and - * directories. The "<<ALL FILES>>" permission with write action is + * directories. The "<<ALL FILES>>" permission with write action is * especially dangerous. This grants permission to write to the entire * file system. One thing this effectively allows is replacement of the * system binary, including the JVM runtime environment. @@ -180,9 +180,7 @@ * @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"); @@ -274,9 +272,7 @@ * If actions is null, empty or contains an action * other than the specified possible actions. */ - - public FilePermission(String path, String actions) - { + public FilePermission(String path, String actions) { super(path); init(getMask(actions)); } @@ -293,8 +289,7 @@ */ // package private for use by the FilePermissionCollection add method - FilePermission(String path, int mask) - { + FilePermission(String path, int mask) { super(path); init(mask); } @@ -337,7 +332,6 @@ * this FilePermission's path also implies that FilePermission's path. * * @param that the FilePermission to check against. - * @param exact return immediately if the masks are not equal * @return the effective mask */ boolean impliesIgnoreMask(FilePermission that) { @@ -412,7 +406,6 @@ * * @return a hash code value for this object. */ - public int hashCode() { return this.cpath.hashCode(); } @@ -424,7 +417,6 @@ * @return the actions mask. */ private static int getMask(String actions) { - int mask = NONE; // Null action valid? @@ -552,7 +544,6 @@ * * @return the actions mask. */ - int getMask() { return mask; } @@ -564,8 +555,7 @@ * * @return the canonical string representation of the actions. */ - private static String getActions(int mask) - { + private static String getActions(int mask) { StringBuilder sb = new StringBuilder(); boolean comma = false; @@ -610,8 +600,7 @@ * * @return the canonical string representation of the actions. */ - public String getActions() - { + public String getActions() { if (actions == null) actions = getActions(this.mask); @@ -618,7 +607,6 @@ return actions; } - /** * Returns a new PermissionCollection object for storing FilePermission * objects. @@ -650,7 +638,6 @@ * @return a new PermissionCollection object suitable for storing * FilePermissions. */ - public PermissionCollection newPermissionCollection() { return new FilePermissionCollection(); } @@ -712,22 +699,20 @@ */ final class FilePermissionCollection extends PermissionCollection -implements Serializable { - + implements Serializable +{ // Not serialized; see serialization section at end of class private transient List perms; /** - * Create an empty FilePermissions object. - * + * Create an empty FilePermissionCollection object. */ - public FilePermissionCollection() { perms = new ArrayList<>(); } /** - * Adds a permission to the FilePermissions. The key for the hash is + * Adds a permission to the FilePermissionCollection. The key for the hash is * permission.path. * * @param permission the Permission object to add. @@ -738,9 +723,7 @@ * @exception SecurityException - if this FilePermissionCollection object * has been marked readonly */ - - public void add(Permission permission) - { + public void add(Permission permission) { if (! (permission instanceof FilePermission)) throw new IllegalArgumentException("invalid permission: "+ permission); @@ -757,16 +740,14 @@ * 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 FilePermission)) - return false; + return false; FilePermission fp = (FilePermission) permission; @@ -795,7 +776,6 @@ * * @return an enumeration of all the FilePermission objects. */ - public Enumeration elements() { // Convert Iterator into Enumeration synchronized (this) { @@ -841,8 +821,9 @@ /* * Reads in a Vector of FilePermissions and saves them in the perms field. */ - private void readObject(ObjectInputStream in) throws IOException, - ClassNotFoundException { + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException + { // Don't call defaultReadObject() // Read in serialized fields