Skip to content

Commit 2c1cca6

Browse files
committed
Polishing
1 parent 00c9875 commit 2c1cca6

File tree

17 files changed

+132
-130
lines changed

17 files changed

+132
-130
lines changed

spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -80,9 +80,8 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
8080
new Converter<Method, Annotation>() {
8181
@Override
8282
public Annotation convert(Method method) {
83-
AspectJAnnotation<?> annotation =
84-
AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(method);
85-
return (annotation != null ? annotation.getAnnotation() : null);
83+
AspectJAnnotation<?> ann = AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(method);
84+
return (ann != null ? ann.getAnnotation() : null);
8685
}
8786
}));
8887
comparator.addComparator(new ConvertingComparator<Method, String>(

spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -136,14 +136,8 @@ private String getAspectName(Advisor anAdvisor) {
136136
}
137137

138138
private int getAspectDeclarationOrder(Advisor anAdvisor) {
139-
AspectJPrecedenceInformation precedenceInfo =
140-
AspectJAopUtils.getAspectJPrecedenceInformationFor(anAdvisor);
141-
if (precedenceInfo != null) {
142-
return precedenceInfo.getDeclarationOrder();
143-
}
144-
else {
145-
return 0;
146-
}
139+
AspectJPrecedenceInformation precedenceInfo = AspectJAopUtils.getAspectJPrecedenceInformationFor(anAdvisor);
140+
return (precedenceInfo != null ? precedenceInfo.getDeclarationOrder() : 0);
147141
}
148142

149143
}

spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -61,12 +61,12 @@ public class AopNamespaceHandler extends NamespaceHandlerSupport {
6161
*/
6262
@Override
6363
public void init() {
64-
// In 2.0 XSD as well as in 2.1 XSD.
64+
// In 2.0 XSD as well as in 2.5+ XSDs
6565
registerBeanDefinitionParser("config", new ConfigBeanDefinitionParser());
6666
registerBeanDefinitionParser("aspectj-autoproxy", new AspectJAutoProxyBeanDefinitionParser());
6767
registerBeanDefinitionDecorator("scoped-proxy", new ScopedProxyBeanDefinitionDecorator());
6868

69-
// Only in 2.0 XSD: moved to context namespace as of 2.1
69+
// Only in 2.0 XSD: moved to context namespace in 2.5+
7070
registerBeanDefinitionParser("spring-configured", new SpringConfiguredBeanDefinitionParser());
7171
}
7272

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,9 +43,9 @@
4343
* Internal class that caches JavaBeans {@link java.beans.PropertyDescriptor}
4444
* information for a Java class. Not intended for direct use by application code.
4545
*
46-
* <p>Necessary for own caching of descriptors within the application's
47-
* ClassLoader, rather than rely on the JDK's system-wide BeanInfo cache
48-
* (in order to avoid leaks on ClassLoader shutdown).
46+
* <p>Necessary for Spring's own caching of bean descriptors within the application
47+
* {@link ClassLoader}, rather than relying on the JDK's system-wide {@link BeanInfo}
48+
* cache (in order to avoid leaks on individual application shutdown in a shared JVM).
4949
*
5050
* <p>Information is cached statically, so we don't need to create new
5151
* objects of this class for every JavaBean we manipulate. Hence, this class
@@ -97,7 +97,7 @@ public class CachedIntrospectionResults {
9797
SpringProperties.getFlag(IGNORE_BEANINFO_PROPERTY_NAME);
9898

9999
/** Stores the BeanInfoFactory instances */
100-
private static List<BeanInfoFactory> beanInfoFactories = SpringFactoriesLoader.loadFactories(
100+
private static final List<BeanInfoFactory> beanInfoFactories = SpringFactoriesLoader.loadFactories(
101101
BeanInfoFactory.class, CachedIntrospectionResults.class.getClassLoader());
102102

103103
private static final Log logger = LogFactory.getLog(CachedIntrospectionResults.class);

spring-beans/src/main/java/org/springframework/beans/factory/annotation/Lookup.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,12 +41,11 @@
4141
* regular constructors: i.e. lookup methods cannot get replaced on beans returned
4242
* from factory methods where we cannot dynamically provide a subclass for them.
4343
*
44-
* <p><b>Concrete limitations in typical Spring configuration scenarios:</b>
45-
* When used with component scanning or any other mechanism that filters out abstract
46-
* beans, provide stub implementations of your lookup methods to be able to declare
47-
* them as concrete classes. And please remember that lookup methods won't work on
48-
* beans returned from {@code @Bean} methods in configuration classes; you'll have
49-
* to resort to {@code @Inject Provider&lt;TargetBean&gt;} or the like instead.
44+
* <p><b>Recommendations for typical Spring configuration scenarios:</b>
45+
* When a concrete class may be needed in certain scenarios, consider providing stub
46+
* implementations of your lookup methods. And please remember that lookup methods
47+
* won't work on beans returned from {@code @Bean} methods in configuration classes;
48+
* you'll have to resort to {@code @Inject Provider<TargetBean>} or the like instead.
5049
*
5150
* @author Juergen Hoeller
5251
* @since 4.1

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ public List<BeanPostProcessor> getBeanPostProcessors() {
879879

880880
/**
881881
* Return whether this factory holds a InstantiationAwareBeanPostProcessor
882-
* that will get applied to singleton beans on shutdown.
882+
* that will get applied to singleton beans on creation.
883883
* @see #addBeanPostProcessor
884884
* @see org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
885885
*/
@@ -1508,7 +1508,7 @@ protected boolean isFactoryBean(String beanName, RootBeanDefinition mbd) {
15081508
* should be used as fallback.
15091509
* @param beanName the name of the bean
15101510
* @param mbd the merged bean definition for the bean
1511-
* @return the type for the bean if determinable, or {@code null} else
1511+
* @return the type for the bean if determinable, or {@code null} otherwise
15121512
* @see org.springframework.beans.factory.FactoryBean#getObjectType()
15131513
* @see #getBean(String)
15141514
*/

spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCache.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@
3535
* @author Juergen Hoeller
3636
* @author Stephane Nicoll
3737
* @since 4.3
38+
* @see CaffeineCacheManager
3839
*/
3940
@UsesJava8
4041
public class CaffeineCache extends AbstractValueAdaptingCache {

spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheCache.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -92,7 +92,6 @@ public <T> T get(Object key, Callable<T> valueLoader) {
9292
this.cache.releaseWriteLockOnKey(key);
9393
}
9494
}
95-
9695
}
9796

9897
private <T> T loadValue(Object key, Callable<T> valueLoader) {

spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheCacheManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@
3232
* @author Juergen Hoeller
3333
* @author Stephane Nicoll
3434
* @since 3.1
35+
* @see EhCacheCache
3536
*/
3637
public class EhCacheCacheManager extends AbstractTransactionSupportingCacheManager {
3738

spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCache.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,29 +27,30 @@
2727

2828
/**
2929
* {@link org.springframework.cache.Cache} implementation on top of a
30-
* {@link javax.cache.Cache} instance.
30+
* {@link Cache javax.cache.Cache} instance.
3131
*
3232
* <p>Note: This class has been updated for JCache 1.0, as of Spring 4.0.
3333
*
3434
* @author Juergen Hoeller
3535
* @author Stephane Nicoll
3636
* @since 3.2
37+
* @see JCacheCacheManager
3738
*/
3839
public class JCacheCache extends AbstractValueAdaptingCache {
3940

4041
private final Cache<Object, Object> cache;
4142

4243

4344
/**
44-
* Create an {@link org.springframework.cache.jcache.JCacheCache} instance.
45+
* Create a {@code JCacheCache} instance.
4546
* @param jcache backing JCache Cache instance
4647
*/
4748
public JCacheCache(Cache<Object, Object> jcache) {
4849
this(jcache, true);
4950
}
5051

5152
/**
52-
* Create an {@link org.springframework.cache.jcache.JCacheCache} instance.
53+
* Create a {@code JCacheCache} instance.
5354
* @param jcache backing JCache Cache instance
5455
* @param allowNullValues whether to accept and convert null values for this cache
5556
*/
@@ -123,7 +124,7 @@ public T process(MutableEntry<Object, Object> entry, Object... arguments) throws
123124
}
124125
catch (Exception ex) {
125126
throw new EntryProcessorException("Value loader '" + valueLoader + "' failed " +
126-
"to compute value for key '" + entry.getKey() + "'", ex);
127+
"to compute value for key '" + entry.getKey() + "'", ex);
127128
}
128129
entry.setValue(toStoreValue(value));
129130
return value;

0 commit comments

Comments
 (0)