Skip to content

Commit

Permalink
Refactor: use diamond operator (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
schrosolver authored Jun 30, 2021
1 parent 27a635b commit 9091ffd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public String getASGName() {
@Override
public Map<String, String> getMetadataMap() {
String metadataNamespace = namespace + INSTANCE_METADATA_PREFIX + ".";
Map<String, String> metadataMap = new LinkedHashMap<String, String>();
Map<String, String> metadataMap = new LinkedHashMap<>();
Configuration config = (Configuration) configInstance.getBackingConfigurationSource();
String subsetPrefix = metadataNamespace.charAt(metadataNamespace.length() - 1) == '.'
? metadataNamespace.substring(0, metadataNamespace.length() - 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static AmazonInfo init(AmazonInfoConfig amazonInfoConfig, FallbackAddres
// The property to not validate instance ids may be set for
// development and in that scenario, populate instance id
// and public hostname with the hostname of the machine
Map<String, String> metadataMap = new HashMap<String, String>();
Map<String, String> metadataMap = new HashMap<>();
metadataMap.put(AmazonInfo.MetaDataKey.instanceId.getName(), fallbackAddressProvider.getFallbackIp());
metadataMap.put(AmazonInfo.MetaDataKey.publicHostname.getName(), fallbackAddressProvider.getFallbackHostname());
info.setMetadata(metadataMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ public Name getName() {
if (info.getName() == Name.Amazon) {
Map<String, String> metadataMap = (Map<String, String>) context
.convertAnother(info, Map.class);
Map<String, String> metadataMapInter = new HashMap<String, String>(metadataMap.size());
Map<String, String> metadataMapInter = new HashMap<>(metadataMap.size());
for (Map.Entry<String, String> entry : metadataMap.entrySet()) {
metadataMapInter.put(StringCache.intern(entry.getKey()), StringCache.intern(entry.getValue()));
}
Expand Down

0 comments on commit 9091ffd

Please sign in to comment.