Object readResolve() { final AbstractPermissionCollection collection = new WildFlySecurityManagerPermission("*").newPermissionCollection(); final StringMapping<WildFlySecurityManagerPermission> mapping = WildFlySecurityManagerPermission.mapping; int bits = p1; int test; while (bits != 0) { collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits)))); bits &= ~test; } if (isReadOnly()) { collection.setReadOnly(); } return collection; } }
/** * Add an item to this collection. The permission class must be the same as the source permission's class. * * @param permission the permission to add (must not be {@code null}) */ public final void add(final Permission permission) { Assert.checkNotNullParam("permission", permission); if (isReadOnly()) throw ElytronMessages.log.readOnlyPermissionCollection(); @SuppressWarnings("rawtypes") Class<? extends AbstractPermission> expected = sourcePermission.getClass().asSubclass(AbstractPermission.class); if (expected != permission.getClass()) { throw ElytronMessages.log.invalidPermissionType(expected, permission); } doAdd(expected.cast(permission)); }
SerializedPermissionCollection(final AbstractPermissionCollection collection) { s = collection.getSourcePermission(); final ArrayList<Permission> list = new ArrayList<>(collection.size()); collection.forEach(list::add); p = list.toArray(PermissionUtil.NO_PERMISSIONS); r = collection.isReadOnly(); }
SerializedPermissionCollection(final AbstractPermissionCollection collection) { s = collection.getSourcePermission(); final ArrayList<Permission> list = new ArrayList<>(collection.size()); collection.forEach(list::add); p = list.toArray(PermissionUtil.NO_PERMISSIONS); r = collection.isReadOnly(); }
Object readResolve() { final AbstractPermissionCollection collection = new ElytronPermission("*").newPermissionCollection(); final StringMapping<ElytronPermission> mapping = ElytronPermission.mapping; int bits = p1; int test; while (bits != 0) { collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits)))); bits &= ~test; } if (isReadOnly()) { collection.setReadOnly(); } return collection; } }
/** * Add an item to this collection. The permission class must be the same as the source permission's class. * * @param permission the permission to add (must not be {@code null}) */ public final void add(final Permission permission) { Assert.checkNotNullParam("permission", permission); if (isReadOnly()) throw ElytronMessages.log.readOnlyPermissionCollection(); @SuppressWarnings("rawtypes") Class<? extends AbstractPermission> expected = sourcePermission.getClass().asSubclass(AbstractPermission.class); if (expected != permission.getClass()) { throw ElytronMessages.log.invalidPermissionType(expected, permission); } doAdd(expected.cast(permission)); }
SerializedPermissionCollection(final AbstractPermissionCollection collection) { s = collection.getSourcePermission(); final ArrayList<Permission> list = new ArrayList<>(collection.size()); collection.forEach(list::add); p = list.toArray(PermissionUtil.NO_PERMISSIONS); r = collection.isReadOnly(); }
Object readResolve() { final AbstractPermissionCollection collection = new WildFlySecurityManagerPermission("*").newPermissionCollection(); final StringMapping<WildFlySecurityManagerPermission> mapping = WildFlySecurityManagerPermission.mapping; int bits = p1; int test; while (bits != 0) { collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits)))); bits &= ~test; } if (isReadOnly()) { collection.setReadOnly(); } return collection; } }
/** * Add an item to this collection. The permission class must be the same as the source permission's class. * * @param permission the permission to add (must not be {@code null}) */ public final void add(final Permission permission) { Assert.checkNotNullParam("permission", permission); if (isReadOnly()) throw ElytronMessages.log.readOnlyPermissionCollection(); @SuppressWarnings("rawtypes") Class<? extends AbstractPermission> expected = sourcePermission.getClass().asSubclass(AbstractPermission.class); if (expected != permission.getClass()) { throw ElytronMessages.log.invalidPermissionType(expected, permission); } doAdd(expected.cast(permission)); }
SerializedPermissionCollection(final AbstractPermissionCollection collection) { s = collection.getSourcePermission(); final ArrayList<Permission> list = new ArrayList<>(collection.size()); collection.forEach(list::add); p = list.toArray(PermissionUtil.NO_PERMISSIONS); r = collection.isReadOnly(); }
Object readResolve() { final AbstractPermissionCollection collection = new ElytronPermission("*").newPermissionCollection(); final StringMapping<ElytronPermission> mapping = ElytronPermission.mapping; int bits = p1; int test; while (bits != 0) { collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits)))); bits &= ~test; } if (isReadOnly()) { collection.setReadOnly(); } return collection; } }
/** * Add an item to this collection. The permission class must be the same as the source permission's class. * * @param permission the permission to add (must not be {@code null}) */ public final void add(final Permission permission) { Assert.checkNotNullParam("permission", permission); if (isReadOnly()) throw ElytronMessages.log.readOnlyPermissionCollection(); @SuppressWarnings("rawtypes") Class<? extends AbstractPermission> expected = sourcePermission.getClass().asSubclass(AbstractPermission.class); if (expected != permission.getClass()) { throw ElytronMessages.log.invalidPermissionType(expected, permission); } doAdd(expected.cast(permission)); }
Object readResolve() { final AbstractPermissionCollection collection = new ElytronPermission("*").newPermissionCollection(); final StringMapping<ElytronPermission> mapping = ElytronPermission.mapping; int bits = p1; int test; while (bits != 0) { collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits)))); bits &= ~test; } if (isReadOnly()) { collection.setReadOnly(); } return collection; } }
Object readResolve() { final AbstractPermissionCollection collection = new WildFlySecurityManagerPermission("*").newPermissionCollection(); final StringMapping<WildFlySecurityManagerPermission> mapping = WildFlySecurityManagerPermission.mapping; int bits = p1; int test; while (bits != 0) { collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits)))); bits &= ~test; } if (isReadOnly()) { collection.setReadOnly(); } return collection; } }
Object readResolve() { final AbstractPermissionCollection collection = new ElytronPermission("*").newPermissionCollection(); final StringMapping<ElytronPermission> mapping = ElytronPermission.mapping; int bits = p1; int test; while (bits != 0) { collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits)))); bits &= ~test; } if (isReadOnly()) { collection.setReadOnly(); } return collection; } }
Object readResolve() { final AbstractPermissionCollection collection = new WildFlySecurityManagerPermission("*").newPermissionCollection(); final StringMapping<WildFlySecurityManagerPermission> mapping = WildFlySecurityManagerPermission.mapping; int bits = p1; int test; while (bits != 0) { collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits)))); bits &= ~test; } if (isReadOnly()) { collection.setReadOnly(); } return collection; } }