equal
deleted
inserted
replaced
723 * Create an empty FilePermissions object. |
723 * Create an empty FilePermissions object. |
724 * |
724 * |
725 */ |
725 */ |
726 |
726 |
727 public FilePermissionCollection() { |
727 public FilePermissionCollection() { |
728 perms = new ArrayList<Permission>(); |
728 perms = new ArrayList<>(); |
729 } |
729 } |
730 |
730 |
731 /** |
731 /** |
732 * Adds a permission to the FilePermissions. The key for the hash is |
732 * Adds a permission to the FilePermissions. The key for the hash is |
733 * permission.path. |
733 * permission.path. |
828 */ |
828 */ |
829 private void writeObject(ObjectOutputStream out) throws IOException { |
829 private void writeObject(ObjectOutputStream out) throws IOException { |
830 // Don't call out.defaultWriteObject() |
830 // Don't call out.defaultWriteObject() |
831 |
831 |
832 // Write out Vector |
832 // Write out Vector |
833 Vector<Permission> permissions = new Vector<Permission>(perms.size()); |
833 Vector<Permission> permissions = new Vector<>(perms.size()); |
834 synchronized (this) { |
834 synchronized (this) { |
835 permissions.addAll(perms); |
835 permissions.addAll(perms); |
836 } |
836 } |
837 |
837 |
838 ObjectOutputStream.PutField pfields = out.putFields(); |
838 ObjectOutputStream.PutField pfields = out.putFields(); |
851 // Read in serialized fields |
851 // Read in serialized fields |
852 ObjectInputStream.GetField gfields = in.readFields(); |
852 ObjectInputStream.GetField gfields = in.readFields(); |
853 |
853 |
854 // Get the one we want |
854 // Get the one we want |
855 Vector<Permission> permissions = (Vector<Permission>)gfields.get("permissions", null); |
855 Vector<Permission> permissions = (Vector<Permission>)gfields.get("permissions", null); |
856 perms = new ArrayList<Permission>(permissions.size()); |
856 perms = new ArrayList<>(permissions.size()); |
857 perms.addAll(permissions); |
857 perms.addAll(permissions); |
858 } |
858 } |
859 } |
859 } |