Source:
<code>public CreateResourceReport createResource(CreateResourceReport report) { if (report.getResourceType().getName().equals(BINDING_TYPE)) { Configuration resourceConfiguration = report.getResourceConfiguration(); PropertyList prop = (PropertyList)resourceConfiguration.get(ENVIRONMENT); List<Property> embeddedProps = prop.getList(); ConfigurationDefinition configDef = report.getResourceType().getResourceConfigurationDefinition().copy(); Map<String, PropertyDefinition> definitions = configDef.getPropertyDefinitions(); PropertyDefinitionList envDefinition = (PropertyDefinitionList)definitions.get(ENVIRONMENT); PropertyDefinitionMap envDefinitionMap = new PropertyDefinitionMap(envDefinition.getName(), envDefinition.getDescription(), envDefinition.isRequired()); definitions.put(ENVIRONMENT, envDefinitionMap); PropertyMap environmentMap = new PropertyMap(); environmentMap.setName(ENVIRONMENT); Map<String, Property> results = new HashMap<String, Property>(); for (Property inner : embeddedProps) { PropertyMap propMap = (PropertyMap) inner; PropertySimple propName = ((PropertySimple) propMap.get("name")); PropertySimple propValue = ((PropertySimple) propMap.get("value")); PropertySimple propS = new PropertySimple(); <START> propS.setName(propName.getStringValue()); <END> propS.setValue(propValue.getStringValue()); results.put(propName.getStringValue(), propS); envDefinitionMap.put(new PropertyDefinitionSimple(propName.getStringValue(), "", true, PropertySimpleType.STRING)); } environmentMap.setMap(results); resourceConfiguration.put(environmentMap); ASConnection connection = getASConnection(); CreateResourceDelegate delegate = new CreateResourceDelegate(configDef, connection, address); return delegate.createResource(report); } return super.createResource(report); }</code><technical_language>null safe</technical_language>

Target:
public CreateResourceReport createResource(CreateResourceReport report) { ConfigurationDefinition configDef = report.getResourceType().getResourceConfigurationDefinition().copy(); if (report.getResourceType().getName().equals(BINDING_TYPE)) { Configuration resourceConfiguration = report.getResourceConfiguration(); PropertyList prop = (PropertyList)resourceConfiguration.get(ENVIRONMENT); if (prop != null) { List<Property> embeddedProps = prop.getList(); Map<String, PropertyDefinition> definitions = configDef.getPropertyDefinitions(); PropertyDefinitionList envDefinition = (PropertyDefinitionList)definitions.get(ENVIRONMENT); PropertyDefinitionMap envDefinitionMap = new PropertyDefinitionMap(envDefinition.getName(), envDefinition.getDescription(), envDefinition.isRequired()); definitions.put(ENVIRONMENT, envDefinitionMap); PropertyMap environmentMap = new PropertyMap(); environmentMap.setName(ENVIRONMENT); Map<String, Property> results = new HashMap<String, Property>(); for (Property inner : embeddedProps) { PropertyMap propMap = (PropertyMap) inner; PropertySimple propName = ((PropertySimple) propMap.get("name")); PropertySimple propValue = ((PropertySimple) propMap.get("value")); if (propName != null && propValue != null ) { PropertySimple propS = new PropertySimple(); propS.setName(propName.getStringValue()); propS.setValue(propValue.getStringValue()); results.put(propName.getStringValue(), propS); envDefinitionMap.put(new PropertyDefinitionSimple(propName.getStringValue(), "", true, PropertySimpleType.STRING)); } } environmentMap.setMap(results); resourceConfiguration.put(environmentMap); } ASConnection connection = getASConnection(); CreateResourceDelegate delegate = new CreateResourceDelegate(configDef, connection, address); return delegate.createResource(report); } return super.createResource(report); }