Polishing

(cherry picked from commit e670f4e)
This commit is contained in:
Juergen Hoeller 2014-01-15 17:45:04 +01:00
parent b6362c5016
commit 52c11eab41
3 changed files with 10 additions and 12 deletions

View File

@ -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).
* <p>Default is "false", considering all {@code BeanInfo} metadata classes, like for
* <p>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.

View File

@ -40,7 +40,7 @@ import org.springframework.util.Assert;
abstract class ReadOnlySystemAttributesMap implements Map<String, String> {
public boolean containsKey(Object key) {
return get(key) != null;
return (get(key) != null);
}
/**
@ -49,9 +49,7 @@ abstract class ReadOnlySystemAttributesMap implements Map<String, String> {
*/
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<String, String> {
/**
* Template method that returns the underlying system attribute.
*
* <p>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<String, String> {
return Collections.emptySet();
}
public void putAll(Map<? extends String, ? extends String> m) {
public void putAll(Map<? extends String, ? extends String> map) {
throw new UnsupportedOperationException();
}

View File

@ -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;
}
}