Skip to content

Commit 55181fa

Browse files
committed
Polishing
1 parent 300ae84 commit 55181fa

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,7 @@ public boolean isTypeMatch(String name, ResolvableType typeToMatch) throws NoSuc
520520
* to check whether the bean with the given name matches the specified type. Allow
521521
* additional constraints to be applied to ensure that beans are not created early.
522522
* @param name the name of the bean to query
523-
* @param typeToMatch the type to match against (as a
524-
* {@code ResolvableType})
523+
* @param typeToMatch the type to match against (as a {@code ResolvableType})
525524
* @return {@code true} if the bean type matches, {@code false} if it
526525
* doesn't match or cannot be determined yet
527526
* @throws NoSuchBeanDefinitionException if there is no bean with the given name

spring-context/src/test/java/org/springframework/cache/interceptor/CacheOperationExpressionEvaluatorTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ class CacheOperationExpressionEvaluatorTests {
6060
private final AnnotationCacheOperationSource source = new AnnotationCacheOperationSource();
6161

6262

63-
private Collection<CacheOperation> getOps(String name) {
64-
Method method = ReflectionUtils.findMethod(AnnotatedClass.class, name, Object.class, Object.class);
65-
return this.source.getCacheOperations(method, AnnotatedClass.class);
66-
}
67-
68-
6963
@Test
7064
void testMultipleCachingSource() {
7165
Collection<CacheOperation> ops = getOps("multipleCaching");
@@ -144,6 +138,12 @@ void resolveBeanReference() {
144138
assertThat(value).isEqualTo(String.class.getName());
145139
}
146140

141+
142+
private Collection<CacheOperation> getOps(String name) {
143+
Method method = ReflectionUtils.findMethod(AnnotatedClass.class, name, Object.class, Object.class);
144+
return this.source.getCacheOperations(method, AnnotatedClass.class);
145+
}
146+
147147
private EvaluationContext createEvaluationContext(Object result) {
148148
return createEvaluationContext(result, null);
149149
}

spring-context/src/test/java/org/springframework/cache/interceptor/CachePutEvaluationTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ void getAndPut() {
104104
assertThat(this.cache.get(anotherValue + 100).get()).as("Wrong value for @CachePut key").isEqualTo(anotherValue);
105105
}
106106

107+
107108
@Configuration
108109
@EnableCaching
109110
static class Config implements CachingConfigurer {
@@ -121,8 +122,10 @@ public SimpleService simpleService() {
121122

122123
}
123124

125+
124126
@CacheConfig("test")
125127
public static class SimpleService {
128+
126129
private AtomicLong counter = new AtomicLong();
127130

128131
/**
@@ -144,4 +147,5 @@ public Long getAndPut(long id) {
144147
return this.counter.getAndIncrement();
145148
}
146149
}
150+
147151
}

0 commit comments

Comments
 (0)