Source:
public boolean addServerRoles(String[] serverRolesArray, String serverRoleType) throws ServerRolesException { log.debug("Adding " + serverRoleType + " Server-Roles to Registry."); Registry configReg = getConfigSystemRegistry(); String regPath = this.getRegistryPath(serverRoleType); if (serverRolesArray != null && serverRolesArray.length != 0) { List<String> serverRolesListToAdd = ServerRoleUtils.arrayToList(serverRolesArray); Resource resource = this.getResourceFromRegistry(configReg, regPath); if (resource == null) { try { resource = configReg.newResource(); resource.setProperty(serverRoleType, serverRolesListToAdd); } catch (RegistryException e) { this.handleException(e.getMessage(), e); } } else { List<String> serverRolesList = resource.getPropertyValues(serverRoleType); serverRolesList = ServerRoleUtils.mergeLists(serverRolesList, serverRolesListToAdd); resource.setProperty(serverRoleType, serverRolesList); } putResourceToRegistry(configReg, resource, regPath); String defaultPath = getRegistryPath(ServerRoleConstants.DEFAULT_ROLES_ID); Resource defaultResource = getResourceFromRegistry(configReg, defaultPath); if (defaultResource == null) { List<String> productServerRolesList = ServerRoleUtils.readProductServerRoles(); try { defaultResource = this.createDefaultProductServerRoles(configReg, productServerRolesList); } catch (RegistryException e) { this.handleException(e.getMessage(), e); } } defaultResource.setProperty(ServerRoleConstants.MODIFIED_TAG, ServerRoleConstants.MODIFIED_TAG_TRUE); putResourceToRegistry(configReg, defaultResource, defaultPath); } return true; }

Target:
public boolean addServerRoles(String[] serverRolesArray, String serverRoleType) throws ServerRolesException { log.debug("Adding " + serverRoleType + " Server-Roles to Registry."); boolean status = false; Registry configReg = getConfigSystemRegistry(); String regPath = this.getRegistryPath(serverRoleType); if (serverRolesArray != null && serverRolesArray.length != 0) { List<String> serverRolesListToAdd = ServerRoleUtils.arrayToList(serverRolesArray); Resource resource = this.getResourceFromRegistry(configReg, regPath); if (resource == null) { try { resource = configReg.newResource(); resource.setProperty(serverRoleType, serverRolesListToAdd); } catch (RegistryException e) { this.handleException(e.getMessage(), e); } } else { List<String> serverRolesList = resource.getPropertyValues(serverRoleType); serverRolesList = ServerRoleUtils.mergeLists(serverRolesList, serverRolesListToAdd); resource.setProperty(serverRoleType, serverRolesList); } putResourceToRegistry(configReg, resource, regPath); String defaultPath = getRegistryPath(ServerRoleConstants.DEFAULT_ROLES_ID); Resource defaultResource = getResourceFromRegistry(configReg, defaultPath); if (defaultResource == null) { List<String> productServerRolesList = ServerRoleUtils.readProductServerRoles(); try { defaultResource = this.createDefaultProductServerRoles(configReg, productServerRolesList); } catch (RegistryException e) { this.handleException(e.getMessage(), e); } } defaultResource.setProperty(ServerRoleConstants.MODIFIED_TAG, ServerRoleConstants.MODIFIED_TAG_TRUE); putResourceToRegistry(configReg, defaultResource, defaultPath); status = true; } return status; }