Browse Source

Polishing

pull/440/head
Juergen Hoeller 12 years ago
parent
commit
e670f4e5c6
  1. 2
      spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java
  2. 10
      spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java

2
spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java

@ -78,7 +78,7 @@ public class CachedIntrospectionResults {
* mode when calling the JavaBeans {@link Introspector}: "spring.beaninfo.ignore", with a * 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 * 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). * 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 * standard {@link Introspector#getBeanInfo(Class)} calls. Consider switching this flag to
* "true" if you experience repeated ClassLoader access for non-existing {@code BeanInfo} * "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. * classes, in case such access is expensive on startup or on lazy loading.

10
spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java vendored

@ -41,7 +41,7 @@ abstract class ReadOnlySystemAttributesMap implements Map<String, String> {
@Override @Override
public boolean containsKey(Object key) { public boolean containsKey(Object key) {
return get(key) != null; return (get(key) != null);
} }
/** /**
@ -51,9 +51,7 @@ abstract class ReadOnlySystemAttributesMap implements Map<String, String> {
@Override @Override
public String get(Object key) { public String get(Object key) {
Assert.isInstanceOf(String.class, key, Assert.isInstanceOf(String.class, key,
String.format("expected key [%s] to be of type String, got %s", String.format("expected key [%s] to be of type String, got %s", key, key.getClass().getName()));
key, key.getClass().getName()));
return this.getSystemAttribute((String) key); return this.getSystemAttribute((String) key);
} }
@ -64,11 +62,11 @@ abstract class ReadOnlySystemAttributesMap implements Map<String, String> {
/** /**
* Template method that returns the underlying system attribute. * Template method that returns the underlying system attribute.
*
* <p>Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here. * <p>Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here.
*/ */
protected abstract String getSystemAttribute(String attributeName); protected abstract String getSystemAttribute(String attributeName);
// Unsupported // Unsupported
@Override @Override
@ -102,7 +100,7 @@ abstract class ReadOnlySystemAttributesMap implements Map<String, String> {
} }
@Override @Override
public void putAll(Map<? extends String, ? extends String> m) { public void putAll(Map<? extends String, ? extends String> map) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

Loading…
Cancel
Save