public void changeNickname(String nickname) {
        this.nick = nickname;
        setRoleAddress(new JID(roomJid.getNode(), roomJid.getDomain(), nick));
        synchronized (this) {
            cacheSize = -1;
        }
    }
Changes the nickname of the occupant within the room to the new nickname.

@param nickname the new nickname of the occupant in the room.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MUCOccupant.java