diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationScopeMetadataResolver.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationScopeMetadataResolver.java index 25f589c4990..eda107dacfb 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationScopeMetadataResolver.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationScopeMetadataResolver.java @@ -24,8 +24,8 @@ import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.util.Assert; /** - * A {@link ScopeMetadataResolver} implementation that (by default) checks for - * the presence of the {@link Scope} annotation on the bean class. + * A {@link ScopeMetadataResolver} implementation that by default checks for + * the presence of Spring's {@link Scope} annotation on the bean class. * *
The exact type of annotation that is checked for is configurable via the * {@link #setScopeAnnotationType(Class)} property. @@ -70,7 +70,7 @@ public class AnnotationScopeMetadataResolver implements ScopeMetadataResolver { Assert.notNull(scopeAnnotationType, "'scopeAnnotationType' must not be null"); this.scopeAnnotationType = scopeAnnotationType; } - + public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) { ScopeMetadata metadata = new ScopeMetadata(); diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/support/FormattingConversionServiceAdapter.java b/org.springframework.context/src/main/java/org/springframework/ui/format/support/FormattingConversionServiceAdapter.java index a6483e8a1bb..f2f524f4be8 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/support/FormattingConversionServiceAdapter.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/support/FormattingConversionServiceAdapter.java @@ -40,6 +40,7 @@ public class FormattingConversionServiceAdapter extends GenericConversionService private final FormatterRegistry formatterRegistry; + /** * Create a new FormattingConversionServiceAdapter for the given FormatterRegistry. * @param formatterRegistry the FormatterRegistry to wrap @@ -49,11 +50,13 @@ public class FormattingConversionServiceAdapter extends GenericConversionService this.formatterRegistry = formatterRegistry; if (formatterRegistry instanceof GenericFormatterRegistry) { setParent(((GenericFormatterRegistry) formatterRegistry).getConversionService()); - } else { + } + else { setParent(new DefaultConversionService()); } } + @Override protected GenericConverter getConverter(TypeDescriptor sourceType, TypeDescriptor targetType) { if (String.class.equals(sourceType.getType())) { @@ -65,6 +68,7 @@ public class FormattingConversionServiceAdapter extends GenericConversionService return super.getConverter(sourceType, targetType); } + /** * Adapter that exposes the Converter interface on top of a given Formatter. */ @@ -79,7 +83,8 @@ public class FormattingConversionServiceAdapter extends GenericConversionService public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { try { return this.formatter.parse((String) source, LocaleContextHolder.getLocale()); - } catch (ParseException ex) { + } + catch (ParseException ex) { throw new IllegalArgumentException("Could not convert formatted value '" + source + "'", ex); } } diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/support/GenericFormatterRegistry.java b/org.springframework.context/src/main/java/org/springframework/ui/format/support/GenericFormatterRegistry.java index 7b47fbe9e63..d9a940aab92 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/support/GenericFormatterRegistry.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/support/GenericFormatterRegistry.java @@ -245,10 +245,12 @@ public class GenericFormatterRegistry implements FormatterRegistry, ApplicationC if (arg instanceof Class) { return (Class) arg; } - } else if (Formatter.class.isAssignableFrom((Class) rawType)) { + } + else if (Formatter.class.isAssignableFrom((Class) rawType)) { return getFormattedObjectType((Class) rawType); } - } else if (Formatter.class.isAssignableFrom((Class) ifc)) { + } + else if (Formatter.class.isAssignableFrom((Class) ifc)) { return getFormattedObjectType((Class) ifc); } }