public void setName(String name) {
        if (Objects.equals(name, this.name) || provider.isReadOnly())
        {
            // Do nothing
            return;
        }
        try {
            String originalName = this.name;
            provider.setName(originalName, name);
            this.name = name;
            this.jid = null; // rebuilt when needed

            groupManager.renameGroupPostProcess(this, originalName);
        }
        catch (GroupAlreadyExistsException e) {
            Log.error("Failed to change group name; group already exists");
        } catch (GroupNameInvalidException e) {
            Log.error("Failed to change group name; new group name is not valid");
        } catch (GroupNotFoundException e) {
            Log.error("Failed to change group name; the provided group name cannot be found");
        }
    }
Sets the name of the group. For example, 'XYZ Admins'. This
method is restricted to those with group administration permission.

@param name the name for the group.
xmppserver/src/main/java/org/jivesoftware/openfire/group/Group.java