From 96596f8eccebd08e845e534c91eeabfebf9b23b9 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 28 Aug 2019 10:55:32 +0200 Subject: [PATCH] Polish contribution See gh-17962 --- .../boot/autoconfigure/AutoConfigurationSorter.java | 3 +-- .../boot/autoconfigure/jmx/ParentAwareNamingStrategy.java | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java index 2c1af6d5f7..0aea6a04cb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java @@ -136,8 +136,7 @@ class AutoConfigurationSorter { } Set getClassesRequestedAfter(String className) { - Set setOfClassesRequestedAfter = get(className).getAfter(); - Set classesRequestedAfter = new LinkedHashSet<>(setOfClassesRequestedAfter); + Set classesRequestedAfter = new LinkedHashSet<>(get(className).getAfter()); this.classes.forEach((name, autoConfigurationClass) -> { if (autoConfigurationClass.getBefore().contains(className)) { classesRequestedAfter.add(name); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/ParentAwareNamingStrategy.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/ParentAwareNamingStrategy.java index 71b7e31f68..492ca6e119 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/ParentAwareNamingStrategy.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/ParentAwareNamingStrategy.java @@ -17,7 +17,6 @@ package org.springframework.boot.autoconfigure.jmx; import java.util.Hashtable; -import java.util.Map; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; @@ -58,8 +57,7 @@ public class ParentAwareNamingStrategy extends MetadataNamingStrategy implements @Override public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException { ObjectName name = super.getObjectName(managedBean, beanKey); - Map keyPropertyList = name.getKeyPropertyList(); - Hashtable properties = new Hashtable<>(keyPropertyList); + Hashtable properties = new Hashtable<>(name.getKeyPropertyList()); if (this.ensureUniqueRuntimeObjectNames) { properties.put("identity", ObjectUtils.getIdentityHexString(managedBean)); }