From 39f8b8c61b9861f7ce6ae597491296ea703aa6b7 Mon Sep 17 00:00:00 2001 From: Mercy Date: Sat, 11 Jan 2025 20:16:25 +0800 Subject: [PATCH] Polish #88 --- .../microsphere/spring/core/annotation/AnnotationUtils.java | 3 +-- .../EnableConfigurationBeanBindingTestForMultipleBinding.java | 2 +- .../io/microsphere/spring/util/SpringVersionUtilsTest.java | 4 ++-- microsphere-spring-parent/pom.xml | 3 +-- microsphere-spring-web/pom.xml | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/microsphere-spring-context/src/main/java/io/microsphere/spring/core/annotation/AnnotationUtils.java b/microsphere-spring-context/src/main/java/io/microsphere/spring/core/annotation/AnnotationUtils.java index 4638352f..d6d0f151 100644 --- a/microsphere-spring-context/src/main/java/io/microsphere/spring/core/annotation/AnnotationUtils.java +++ b/microsphere-spring-context/src/main/java/io/microsphere/spring/core/annotation/AnnotationUtils.java @@ -21,7 +21,6 @@ import java.util.Map; import java.util.Set; -import static java.lang.String.valueOf; import static java.util.Arrays.asList; import static java.util.Collections.emptyMap; import static java.util.Collections.unmodifiableMap; @@ -180,7 +179,7 @@ public static Map getAttributes(Map annotationAt } if (attributeValue instanceof String) { - attributeValue = resolvePlaceholders(valueOf(attributeValue), propertyResolver); + attributeValue = resolvePlaceholders((String) attributeValue, propertyResolver); } else if (attributeValue instanceof String[]) { String[] values = (String[]) attributeValue; for (int i = 0; i < values.length; i++) { diff --git a/microsphere-spring-context/src/test/java/io/microsphere/spring/beans/factory/annotation/EnableConfigurationBeanBindingTestForMultipleBinding.java b/microsphere-spring-context/src/test/java/io/microsphere/spring/beans/factory/annotation/EnableConfigurationBeanBindingTestForMultipleBinding.java index 4e100dbd..4ce807ca 100644 --- a/microsphere-spring-context/src/test/java/io/microsphere/spring/beans/factory/annotation/EnableConfigurationBeanBindingTestForMultipleBinding.java +++ b/microsphere-spring-context/src/test/java/io/microsphere/spring/beans/factory/annotation/EnableConfigurationBeanBindingTestForMultipleBinding.java @@ -32,9 +32,9 @@ import java.util.Collection; import static io.microsphere.spring.beans.BeanUtils.getSortedBeans; -import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; @EnableConfigurationBeanBinding(prefix = "users", type = User.class, multiple = true, ignoreUnknownFields = false, ignoreInvalidFields = false) diff --git a/microsphere-spring-context/src/test/java/io/microsphere/spring/util/SpringVersionUtilsTest.java b/microsphere-spring-context/src/test/java/io/microsphere/spring/util/SpringVersionUtilsTest.java index a2d77810..45a6ea8c 100644 --- a/microsphere-spring-context/src/test/java/io/microsphere/spring/util/SpringVersionUtilsTest.java +++ b/microsphere-spring-context/src/test/java/io/microsphere/spring/util/SpringVersionUtilsTest.java @@ -50,8 +50,8 @@ public void testGetSpringVersionOnIAE() { @Test public void testGetSpringVersion() { Version version = getSpringVersion(StringUtils.class); - assertEquals(version,SPRING_AOP_VERSION); - assertEquals(SPRING_CORE_VERSION,SPRING_AOP_VERSION); + assertEquals(version, SPRING_AOP_VERSION); + assertEquals(SPRING_CORE_VERSION, SPRING_AOP_VERSION); assertEquals(SPRING_AOP_VERSION, SPRING_BEANS_VERSION); assertEquals(SPRING_BEANS_VERSION, SPRING_CONTEXT_VERSION); assertEquals(SPRING_CONTEXT_VERSION, SPRING_CONTEXT_SUPPORT_VERSION); diff --git a/microsphere-spring-parent/pom.xml b/microsphere-spring-parent/pom.xml index 540f57dc..54f440ba 100644 --- a/microsphere-spring-parent/pom.xml +++ b/microsphere-spring-parent/pom.xml @@ -63,7 +63,6 @@ javax.servlet javax.servlet-api ${servlet-api.version} - provided @@ -73,7 +72,7 @@ ${junit.version} - + org.mockito mockito-bom diff --git a/microsphere-spring-web/pom.xml b/microsphere-spring-web/pom.xml index a5d4b363..cbbace68 100644 --- a/microsphere-spring-web/pom.xml +++ b/microsphere-spring-web/pom.xml @@ -67,7 +67,7 @@ jackson-databind true - + org.slf4j