if (!sala.getNome().equals(salaNova.getNome())) { ISala roomWithSameName = sp.getISalaPersistente().readByName(salaNova.getNome()); if (roomWithSameName != null) throw new ExistingServiceException(); }  if (sala != null) {
if (!sala.getNome().equals(salaNova.getNome())) { ISala roomWithSameName = sp.getISalaPersistente().readByName(salaNova.getNome()); if (roomWithSameName != null) throw new ExistingServiceException(); }
  public Object run(RoomKey salaAntiga, InfoRoom salaNova)  	throws ExistingServiceException {    ISala sala = null;    boolean result = false;    try {      ISuportePersistente sp = SuportePersistenteOJB.getInstance();      sala = sp.getISalaPersistente().readByName(salaAntiga.getNomeSala());      if (!sala.getNome().equals(salaNova.getNome())) { 		  ISala roomWithSameName = sp.getISalaPersistente().readByName(salaNova.getNome());	  	if (roomWithSameName != null)			throw new ExistingServiceException();      }      if (sala != null) {          sala.setNome(salaNova.getNome());          sala.setEdificio(salaNova.getEdificio());          sala.setPiso(salaNova.getPiso());          sala.setCapacidadeNormal(salaNova.getCapacidadeNormal());          sala.setCapacidadeExame(salaNova.getCapacidadeExame());          sala.setTipo(salaNova.getTipo());          sp.getISalaPersistente().lockWrite(sala);          result = true;      }    } catch (ExcepcaoPersistencia ex) {      ex.printStackTrace();    }        return new Boolean (result);  }