if (store) { try { userAdminStore.addRole(newRole); } catch (BackingStoreException ex) { return (null); } if (eventProducer != null) { eventProducer.generateEvent(UserAdminEvent.ROLE_CREATED, newRole); }
synchronized (this) { return createRole(name, type, true);
	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);	}