Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: use diamond operator #1412

Merged
merged 1 commit into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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