if(person.hasRole(role.getRoleType())){ throw new DomainException("error.person.addingRoleTwice", role.getRoleType().toString()); }   if (!verifiesDependencies(person, role)) { throw new DomainException("error.person.addingInvalidRole", role .getRoleType().toString()); }  PersonRole_Base.add(person, role); person.updateUsername(); }
if (!person.hasRole(role.getRoleType())) {    if (!verifiesDependencies(person, role)) { throw new DomainException("error.person.addingInvalidRole", role.getRoleType() .toString()); }   PersonRole_Base.add(person, role);  }  person.updateUsername(); }
	public static void add(IPerson person, IRole role) {		//verify if the person already has the role being inserted		if(person.hasRole(role.getRoleType())){			throw new DomainException("error.person.addingRoleTwice", role.getRoleType().toString());		}		// verify role dependencies and throw a DomainException in case they		// aren't met.		if (!verifiesDependencies(person, role)) {			throw new DomainException("error.person.addingInvalidRole", role					.getRoleType().toString());		}		// associate the role with the person		PersonRole_Base.add(person, role);		person.updateUsername();	}