@Test public void testSerialization() { SomePermission perm = new SomePermission("name1"); SerializedPermission obj = (SerializedPermission) perm.writeReplace(); SomePermission resolved = (SomePermission) obj.readResolve(); assertEquals(perm, resolved); AbstractPermissionCollection permissions = perm.newPermissionCollection(); permissions.add(new SomePermission("name2")); SerializedPermissionCollection obj2 = (SerializedPermissionCollection) permissions.writeReplace(); AbstractPermissionCollection resolvedCollection = (AbstractPermissionCollection) obj2.readResolve(); assertTrue(PermissionUtil.equals(permissions, resolvedCollection)); Iterator<Permission> iterator = resolvedCollection.iterator(); assertTrue(iterator.hasNext()); assertEquals(new SomePermission("name2"), iterator.next()); assertFalse(iterator.hasNext()); }
public AbstractPermissionCollection newPermissionCollection() { return NameSetPermissionCollection.newInstance(this, nameEnumeration); }
AbstractNameSetOnlyPermission extends AbstractNameOnlyPermission<This> { public AbstractPermissionCollection newPermissionCollection() { return NameSetPermissionCollection.newInstance(this, nameEnumeration); } }
AbstractNameSetOnlyPermission extends AbstractNameOnlyPermission<This> { public AbstractPermissionCollection newPermissionCollection() { return NameSetPermissionCollection.newInstance(this, nameEnumeration); } protected  AbstractNameSetOnlyPermission(final String name, final StringEnumeration nameEnumeration); }
AbstractNameSetOnlyPermission extends AbstractNameOnlyPermission<This> { public AbstractPermissionCollection newPermissionCollection() { return NameSetPermissionCollection.newInstance(this, nameEnumeration); } protected  AbstractNameSetOnlyPermission(final String name, final StringEnumeration nameEnumeration); AbstractPermissionCollection newPermissionCollection(); final boolean nameEquals(final String name); final boolean impliesName(final String name); }
AbstractNameSetOnlyPermission extends AbstractNameOnlyPermission<This> { public AbstractPermissionCollection newPermissionCollection() { return NameSetPermissionCollection.newInstance(this, nameEnumeration); } protected  AbstractNameSetOnlyPermission(final String name, final StringEnumeration nameEnumeration); AbstractPermissionCollection newPermissionCollection(); final boolean nameEquals(final String name); final boolean impliesName(final String name);  }