Polishing

This commit is contained in:
Juergen Hoeller
2019-02-25 17:36:37 +01:00
parent a3fb52e402
commit 82f1340c47
20 changed files with 87 additions and 91 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -85,9 +85,9 @@ import org.springframework.util.StringUtils;
* another using the {@link Import} annotation).
*
* <p>This class helps separate the concern of parsing the structure of a Configuration
* class from the concern of registering BeanDefinition objects based on the
* content of that model (with the exception of {@code @ComponentScan} annotations which
* need to be registered immediately).
* class from the concern of registering BeanDefinition objects based on the content of
* that model (with the exception of {@code @ComponentScan} annotations which need to be
* registered immediately).
*
* <p>This ASM-based implementation avoids reflection and eager class loading in order to
* interoperate effectively with lazy class loading in a Spring ApplicationContext.
@@ -814,7 +814,7 @@ class ConfigurationClassParser {
return new AssignableTypeFilter(clazz).match((MetadataReader) this.source, metadataReaderFactory);
}
public ConfigurationClass asConfigClass(ConfigurationClass importedBy) throws IOException {
public ConfigurationClass asConfigClass(ConfigurationClass importedBy) {
if (this.source instanceof Class) {
return new ConfigurationClass((Class<?>) this.source, importedBy);
}
@@ -882,7 +882,7 @@ class ConfigurationClassParser {
return result;
}
public Set<SourceClass> getAnnotations() throws IOException {
public Set<SourceClass> getAnnotations() {
Set<SourceClass> result = new LinkedHashSet<SourceClass>();
for (String className : this.metadata.getAnnotationTypes()) {
try {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -428,7 +428,7 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
}
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
public Object postProcessBeforeInitialization(Object bean, String beanName) {
if (bean instanceof ImportAware) {
ImportRegistry ir = this.beanFactory.getBean(IMPORT_REGISTRY_BEAN_NAME, ImportRegistry.class);
AnnotationMetadata importingClass = ir.getImportingClassFor(bean.getClass().getSuperclass().getName());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -257,7 +257,7 @@ public abstract class AbstractApplicationEventMulticaster
* type before trying to instantiate it.
* <p>If this method returns {@code true} for a given listener as a first pass,
* the listener instance will get retrieved and fully evaluated through a
* {@link #supportsEvent(ApplicationListener,ResolvableType, Class)} call afterwards.
* {@link #supportsEvent(ApplicationListener, ResolvableType, Class)} call afterwards.
* @param listenerType the listener's type as determined by the BeanFactory
* @param eventType the event type to check
* @return whether the given listener should be included in the candidates

View File

@@ -1214,7 +1214,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
@Override
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType)
throws NoSuchBeanDefinitionException{
throws NoSuchBeanDefinitionException {
assertBeanFactoryActive();
return getBeanFactory().findAnnotationOnBean(beanName, annotationType);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -292,7 +292,7 @@ public class ResourceBundleMessageSource extends AbstractResourceBasedMessageSou
try {
return bundle.getString(key);
}
catch (MissingResourceException ex){
catch (MissingResourceException ex) {
// Assume key not found for some other reason
// -> do NOT throw the exception to allow for checking parent message source.
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,14 +35,13 @@ import org.springframework.core.NamedThreadLocal;
* or through a {@link org.springframework.beans.factory.config.CustomScopeConfigurer} bean.
*
* <p>{@code SimpleThreadScope} <em>does not clean up any objects</em> associated with it.
* As such, it is typically preferable to use
* {@link org.springframework.web.context.request.RequestScope RequestScope}
* in web environments.
* It is therefore typically preferable to use a request-bound scope implementation such
* as {@code org.springframework.web.context.request.RequestScope} in web environments,
* implementing the full lifecycle for scoped attributes (including reliable destruction).
*
* <p>For an implementation of a thread-based {@code Scope} with support for
* destruction callbacks, refer to the
* <a href="http://www.springbyexample.org/examples/custom-thread-scope-module.html">
* Spring by Example Custom Thread Scope Module</a>.
* <p>For an implementation of a thread-based {@code Scope} with support for destruction
* callbacks, refer to
* <a href="http://www.springbyexample.org/examples/custom-thread-scope-module.html">Spring by Example</a>.
*
* <p>Thanks to Eugene Kuleshov for submitting the original prototype for a thread scope!
*