Source:
<code>public NodeMetadata apply(VApp from) { NodeMetadataBuilder builder = new NodeMetadataBuilder(); builder.ids(from.getHref().toASCIIString()); builder.uri(from.getHref()); builder.name(from.getName()); String groupName = ""; if (!isNullOrEmpty(from.getDescription()) && from.getDescription().indexOf('=') != -1 && from.getDescription().indexOf('\n') != -1) { try { Map<String, String> metadataMap = Splitter.on('\n').withKeyValueSeparator("=").split(from.getDescription()); addMetadataAndParseTagsFromCommaDelimitedValue(builder, metadataMap); if (metadataMap.get("jclouds-group") != null) { groupName = metadataMap.get("jclouds-group"); } } catch (IllegalArgumentException iae) { } } builder.hostname(from.getName()); builder.location(findLocationForResourceInVDC.apply(from.getVDC())); <START> if (groupName.equals("")) { <END> groupName = nodeNamingConvention.groupInUniqueNameOrNull(from.getName()); } builder.group(groupName); builder.operatingSystem(toComputeOs(from, null)); builder.hardware(hardwareForVApp.apply(from)); builder.status(vAppStatusToNodeStatus.get(from.getStatus())); Set<String> addresses = getIpsFromVApp(from); builder.publicAddresses(filter(addresses, not(IsPrivateIPAddress.INSTANCE))); builder.privateAddresses(filter(addresses, IsPrivateIPAddress.INSTANCE)); Credentials fromApi = getCredentialsFrom(from); if (fromApi != null && !credentialStore.containsKey("node#" + from.getHref().toASCIIString())) credentialStore.put("node#" + from.getHref().toASCIIString(), fromApi); return builder.build(); }</code><technical_language>metadataMap.get("jclouds-group") return empty string? If not, String groupName = null; ... groupName = metadataMap.get("jclouds-group"); // null ... if (groupName == null) { groupName = nodeNamingConvention.groupInUniqueNameOrNull(from.getName()); } ..</technical_language>

Target:
public NodeMetadata apply(VApp from) { NodeMetadataBuilder builder = new NodeMetadataBuilder(); builder.ids(from.getHref().toASCIIString()); builder.uri(from.getHref()); builder.name(from.getName()); String groupName = ""; Map<String, String> metadataMap; if (!isNullOrEmpty(from.getDescription()) && from.getDescription().indexOf('=') != -1 && from.getDescription().indexOf('\n') != -1) { try { metadataMap = Splitter.on('\n').withKeyValueSeparator("=").split(from.getDescription()); addMetadataAndParseTagsFromCommaDelimitedValue(builder, metadataMap); } catch (IllegalArgumentException iae) { metadataMap = ImmutableMap.of(); } } else { metadataMap = ImmutableMap.of(); } builder.hostname(from.getName()); builder.location(findLocationForResourceInVDC.apply(from.getVDC())); builder.group(groupFromMapOrName(metadataMap, from.getName(), nodeNamingConvention)); builder.operatingSystem(toComputeOs(from, null)); builder.hardware(hardwareForVApp.apply(from)); builder.status(vAppStatusToNodeStatus.get(from.getStatus())); Set<String> addresses = getIpsFromVApp(from); builder.publicAddresses(filter(addresses, not(IsPrivateIPAddress.INSTANCE))); builder.privateAddresses(filter(addresses, IsPrivateIPAddress.INSTANCE)); Credentials fromApi = getCredentialsFrom(from); if (fromApi != null && !credentialStore.containsKey("node#" + from.getHref().toASCIIString())) credentialStore.put("node#" + from.getHref().toASCIIString(), fromApi); return builder.build(); }