protected org.osgi.service.useradmin.Role createRole(String name, int type, boolean store) { Role newRole = null; if (type == Role.ROLE) { newRole = new Role(name, this); } else if (type == Role.USER) { newRole = new User(name, this); } else if (type == Role.GROUP) { newRole = new Group(name, this); } else {
public org.osgi.service.useradmin.Role createRole(String name, int type) { checkAlive(); checkAdminPermission(); if (name == null) { throw (new IllegalArgumentException(UserAdminMsg.CREATE_NULL_ROLE_EXCEPTION)); } if ((type != org.osgi.service.useradmin.Role.GROUP) && (type != org.osgi.service.useradmin.Role.USER)) { throw (new IllegalArgumentException(UserAdminMsg.CREATE_INVALID_TYPE_ROLE_EXCEPTION)); }  if (getRole(name) != null) {
	protected org.osgi.service.useradmin.Role createRole(String name, int type, boolean store) {		Role newRole = null;		if (type == Role.ROLE) {			newRole = new Role(name, this);		} else if (type == Role.USER) {			newRole = new User(name, this);		} else if (type == Role.GROUP) {			newRole = new Group(name, this);		} else //unknown type		{			return (null);		}		if (store) {			try {				userAdminStore.addRole(newRole);			} catch (BackingStoreException ex) {				return (null);			}			if (eventProducer != null) {				eventProducer.generateEvent(UserAdminEvent.ROLE_CREATED, newRole);			}		}		if (type == Role.GROUP || type == Role.USER) {			users.addElement(newRole);		}		roles.addElement(newRole);		return (newRole);	}