Skip to content

Commit 6d6cf01

Browse files
committed
Polishing
1 parent d003f66 commit 6d6cf01

File tree

5 files changed

+19
-23
lines changed

5 files changed

+19
-23
lines changed

spring-context/src/main/java/org/springframework/context/support/PostProcessorRegistrationDelegate.java

Lines changed: 3 additions & 3 deletions
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-2017 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.
@@ -322,7 +322,7 @@ public Object postProcessAfterInitialization(Object bean, String beanName) {
322322
if (bean != null && !(bean instanceof BeanPostProcessor) && !isInfrastructureBean(beanName) &&
323323
this.beanFactory.getBeanPostProcessorCount() < this.beanPostProcessorTargetCount) {
324324
if (logger.isInfoEnabled()) {
325-
logger.info("Bean '" + beanName + "' of type [" + bean.getClass() +
325+
logger.info("Bean '" + beanName + "' of type [" + bean.getClass().getName() +
326326
"] is not eligible for getting processed by all BeanPostProcessors " +
327327
"(for example: not eligible for auto-proxying)");
328328
}
@@ -333,7 +333,7 @@ public Object postProcessAfterInitialization(Object bean, String beanName) {
333333
private boolean isInfrastructureBean(String beanName) {
334334
if (beanName != null && this.beanFactory.containsBeanDefinition(beanName)) {
335335
BeanDefinition bd = this.beanFactory.getBeanDefinition(beanName);
336-
return RootBeanDefinition.ROLE_INFRASTRUCTURE == bd.getRole();
336+
return (bd.getRole() == RootBeanDefinition.ROLE_INFRASTRUCTURE);
337337
}
338338
return false;
339339
}

spring-context/src/main/java/org/springframework/scheduling/annotation/AsyncAnnotationAdvisor.java

Lines changed: 4 additions & 3 deletions
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-2017 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.
@@ -159,11 +159,12 @@ protected Pointcut buildPointcut(Set<Class<? extends Annotation>> asyncAnnotatio
159159
Pointcut cpc = new AnnotationMatchingPointcut(asyncAnnotationType, true);
160160
Pointcut mpc = AnnotationMatchingPointcut.forMethodAnnotation(asyncAnnotationType);
161161
if (result == null) {
162-
result = new ComposablePointcut(cpc).union(mpc);
162+
result = new ComposablePointcut(cpc);
163163
}
164164
else {
165-
result.union(cpc).union(mpc);
165+
result.union(cpc);
166166
}
167+
result = result.union(mpc);
167168
}
168169
return result;
169170
}

spring-context/src/test/java/org/springframework/cache/config/CacheableService.java

Lines changed: 3 additions & 3 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-2017 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.
@@ -17,7 +17,7 @@
1717
package org.springframework.cache.config;
1818

1919
/**
20-
* Basic service interface.
20+
* Basic service interface for caching tests.
2121
*
2222
* @author Costin Leau
2323
* @author Phillip Webb
@@ -83,7 +83,6 @@ public interface CacheableService<T> {
8383

8484
T throwUncheckedSync(Object arg1);
8585

86-
// multi annotations
8786
T multiCache(Object arg1);
8887

8988
T multiEvict(Object arg1);
@@ -95,4 +94,5 @@ public interface CacheableService<T> {
9594
T multiUpdate(Object arg1);
9695

9796
TestEntity putRefersToResult(TestEntity arg1);
97+
9898
}

spring-context/src/test/java/org/springframework/cache/config/DefaultCacheableService.java

Lines changed: 4 additions & 2 deletions
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-2017 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.
@@ -25,7 +25,7 @@
2525
import org.springframework.cache.annotation.Caching;
2626

2727
/**
28-
* Simple cacheable service
28+
* Simple cacheable service.
2929
*
3030
* @author Costin Leau
3131
* @author Phillip Webb
@@ -34,8 +34,10 @@
3434
public class DefaultCacheableService implements CacheableService<Long> {
3535

3636
private final AtomicLong counter = new AtomicLong();
37+
3738
private final AtomicLong nullInvocations = new AtomicLong();
3839

40+
3941
@Override
4042
@Cacheable("testCache")
4143
public Long cache(Object arg1) {

spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java

Lines changed: 5 additions & 12 deletions
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-2017 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.
@@ -65,8 +65,6 @@ public void testCacheErrorHandler() {
6565
assertSame(this.ctx.getBean("errorHandler", CacheErrorHandler.class), ci.getErrorHandler());
6666
}
6767

68-
// --- local tests -------
69-
7068
@Test
7169
public void singleCacheManagerBean() throws Throwable {
7270
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
@@ -92,7 +90,7 @@ public void multipleCacheManagerBeans() throws Throwable {
9290
public void multipleCacheManagerBeans_implementsCachingConfigurer() {
9391
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
9492
ctx.register(MultiCacheManagerConfigurer.class);
95-
ctx.refresh(); // does not throw
93+
ctx.refresh(); // does not throw an exception
9694
}
9795

9896
@Test(expected = IllegalStateException.class)
@@ -125,22 +123,17 @@ public void noCacheManagerBeans() throws Throwable {
125123

126124
@Test
127125
public void emptyConfigSupport() {
128-
ConfigurableApplicationContext context =
129-
new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);
130-
126+
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);
131127
CacheInterceptor ci = context.getBean(CacheInterceptor.class);
132128
assertNotNull(ci.getCacheResolver());
133129
assertEquals(SimpleCacheResolver.class, ci.getCacheResolver().getClass());
134-
assertSame(context.getBean(CacheManager.class),
135-
((SimpleCacheResolver)ci.getCacheResolver()).getCacheManager());
130+
assertSame(context.getBean(CacheManager.class), ((SimpleCacheResolver)ci.getCacheResolver()).getCacheManager());
136131
context.close();
137132
}
138133

139134
@Test
140135
public void bothSetOnlyResolverIsUsed() {
141-
ConfigurableApplicationContext context =
142-
new AnnotationConfigApplicationContext(FullCachingConfig.class);
143-
136+
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(FullCachingConfig.class);
144137
CacheInterceptor ci = context.getBean(CacheInterceptor.class);
145138
assertSame(context.getBean("cacheResolver"), ci.getCacheResolver());
146139
assertSame(context.getBean("keyGenerator"), ci.getKeyGenerator());

0 commit comments

Comments
 (0)