}
}
// Check if the desired nickname is already reserved for another member
if (nickname != null && nickname.trim().length() > 0 && members.containsValue(nickname)) {
if (!nickname.equals(members.get(jid.toBareJID()))) {
throw new ConflictException();
}
}
// Check that the room always has an owner
if (owners.contains(jid.toBareJID()) && owners.size() == 1) {
throw new ConflictException();
}
// Associate the reserved nickname with the bareJID. If nickname is null then associate an
// empty string
members.put(jid.toBareJID(), (nickname == null ? "" : nickname));
// Remove the user from other affiliation lists