public void add(Permission permission) {
if (isReadOnly()) {
throw new SecurityException(Messages.getString("auth.21")); //$NON-NLS-1$
}
if (permission == null || !(permission instanceof ServicePermission)) {
throw new IllegalArgumentException(Messages.getString("auth.22",permission)); //$NON-NLS-1$
}
synchronized (this) {
if (offset == items.length) {
ServicePermission[] sp = new ServicePermission[items.length * 2];
System.arraycopy(items, 0, sp, 0, offset);
items = sp;
}
items[offset++] = (ServicePermission) permission;
}
}
Adds a ServicePermission to the collection. |