diff --git a/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java b/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java index f99f920b203..eb2cd89b9a3 100644 --- a/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java +++ b/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java @@ -76,7 +76,7 @@ public class CachedIntrospectionResults { * mode when calling the JavaBeans {@link Introspector}: "spring.beaninfo.ignore", with a * value of "true" skipping the search for {@code BeanInfo} classes (typically for scenarios * where no such classes are being defined for beans in the application in the first place). - *

Default is "false", considering all {@code BeanInfo} metadata classes, like for + *

The default is "false", considering all {@code BeanInfo} metadata classes, like for * standard {@link Introspector#getBeanInfo(Class)} calls. Consider switching this flag to * "true" if you experience repeated ClassLoader access for non-existing {@code BeanInfo} * classes, in case such access is expensive on startup or on lazy loading. diff --git a/spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java b/spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java index 5ded8cbbc5e..2f770277109 100644 --- a/spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java +++ b/spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java @@ -40,7 +40,7 @@ import org.springframework.util.Assert; abstract class ReadOnlySystemAttributesMap implements Map { public boolean containsKey(Object key) { - return get(key) != null; + return (get(key) != null); } /** @@ -49,9 +49,7 @@ abstract class ReadOnlySystemAttributesMap implements Map { */ public String get(Object key) { Assert.isInstanceOf(String.class, key, - String.format("expected key [%s] to be of type String, got %s", - key, key.getClass().getName())); - + String.format("Expected key [%s] to be of type String, got %s", key, key.getClass().getName())); return this.getSystemAttribute((String) key); } @@ -61,11 +59,11 @@ abstract class ReadOnlySystemAttributesMap implements Map { /** * Template method that returns the underlying system attribute. - * *

Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here. */ protected abstract String getSystemAttribute(String attributeName); + // Unsupported public int size() { @@ -92,7 +90,7 @@ abstract class ReadOnlySystemAttributesMap implements Map { return Collections.emptySet(); } - public void putAll(Map m) { + public void putAll(Map map) { throw new UnsupportedOperationException(); } diff --git a/spring-core/src/main/java/org/springframework/util/ObjectUtils.java b/spring-core/src/main/java/org/springframework/util/ObjectUtils.java index 14e3542c77b..5d6b9c5e5d6 100644 --- a/spring-core/src/main/java/org/springframework/util/ObjectUtils.java +++ b/spring-core/src/main/java/org/springframework/util/ObjectUtils.java @@ -59,10 +59,10 @@ public abstract class ObjectUtils { } /** - * Check whether the given exception is compatible with the exceptions - * declared in a throws clause. - * @param ex the exception to checked - * @param declaredExceptions the exceptions declared in the throws clause + * Check whether the given exception is compatible with the specified + * exception types, as declared in a throws clause. + * @param ex the exception to check + * @param declaredExceptions the exception types declared in the throws clause * @return whether the given exception is compatible */ public static boolean isCompatibleWithThrowsClause(Throwable ex, Class... declaredExceptions) { @@ -71,7 +71,7 @@ public abstract class ObjectUtils { } if (declaredExceptions != null) { for (Class declaredException : declaredExceptions) { - if (declaredException.isAssignableFrom(ex.getClass())) { + if (declaredException.isInstance(ex)) { return true; } }