Source:
<code>private SimpleDescriptor parseXmlDescriptor(String name, String xmlValue) { try { final SimpleDescriptorImpl descriptor = new SimpleDescriptorImpl(); descriptor.setName(name); final String[] configurationPairs = xmlValue.split(";"); for (String configurationPair : configurationPairs) { String[] parameterPairParts = configurationPair.trim().split("=", 2); String parameterName = parameterPairParts[0].trim(); switch (parameterName) { case CONFIG_NAME_DISCOVERY_TYPE: descriptor.setDiscoveryType(parameterPairParts[1].trim()); break; case CONFIG_NAME_DISCOVERY_ADDRESS: descriptor.setDiscoveryAddress(parameterPairParts[1].trim()); break; case CONFIG_NAME_DISCOVERY_USER: descriptor.setDiscoveryUser(parameterPairParts[1].trim()); break; case CONFIG_NAME_DISCOVERY_PASSWORD_ALIAS: descriptor.setDiscoveryPasswordAlias(parameterPairParts[1].trim()); break; case CONFIG_NAME_DISCOVERY_CLUSTER: descriptor.setCluster(parameterPairParts[1].trim()); break; case CONFIG_NAME_PROVIDER_CONFIG_REFERENCE: descriptor.setProviderConfig(parameterPairParts[1].trim()); break; default: if (parameterName.startsWith(CONFIG_NAME_APPLICATION_PREFIX)) { parseApplication(descriptor, configurationPair.trim()); } else { parseService(descriptor, configurationPair.trim()); } break; } } <START> if (advancedServiceDiscoveryConfigMap.containsKey(name)) { setDiscoveryDetails(descriptor, advancedServiceDiscoveryConfigMap.get(name)); addEnabledServices(descriptor, advancedServiceDiscoveryConfigMap.get(name)); <END> } return descriptor; } catch (Exception e) { log.failedToParseDescriptor(name, e.getMessage(), e); return null; } }</code><technical_language>Nit: pull name out a variable check if null avoid multiple map lookups</technical_language>

Target:
private SimpleDescriptor parseXmlDescriptor(String name, String xmlValue) { try { final SimpleDescriptorImpl descriptor = new SimpleDescriptorImpl(); descriptor.setName(name); final String[] configurationPairs = xmlValue.split(";"); for (String configurationPair : configurationPairs) { String[] parameterPairParts = configurationPair.trim().split("=", 2); String parameterName = parameterPairParts[0].trim(); switch (parameterName) { case CONFIG_NAME_DISCOVERY_TYPE: descriptor.setDiscoveryType(parameterPairParts[1].trim()); break; case CONFIG_NAME_DISCOVERY_ADDRESS: descriptor.setDiscoveryAddress(parameterPairParts[1].trim()); break; case CONFIG_NAME_DISCOVERY_USER: descriptor.setDiscoveryUser(parameterPairParts[1].trim()); break; case CONFIG_NAME_DISCOVERY_PASSWORD_ALIAS: descriptor.setDiscoveryPasswordAlias(parameterPairParts[1].trim()); break; case CONFIG_NAME_DISCOVERY_CLUSTER: descriptor.setCluster(parameterPairParts[1].trim()); break; case CONFIG_NAME_PROVIDER_CONFIG_REFERENCE: descriptor.setProviderConfig(parameterPairParts[1].trim()); break; default: if (parameterName.startsWith(CONFIG_NAME_APPLICATION_PREFIX)) { parseApplication(descriptor, configurationPair.trim()); } else { parseService(descriptor, configurationPair.trim()); } break; } } final AdvancedServiceDiscoveryConfig advancedServiceDiscoveryConfig = advancedServiceDiscoveryConfigMap.get(name); if (advancedServiceDiscoveryConfig != null) { setDiscoveryDetails(descriptor, advancedServiceDiscoveryConfig); addEnabledServices(descriptor, advancedServiceDiscoveryConfig); } return descriptor; } catch (Exception e) { log.failedToParseDescriptor(name, e.getMessage(), e); return null; } }