Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
* @author Phillip Webb
* @author Stephane Nicoll
* @author Sam Brannen
* @author Kamil Krzywański
* @since 3.1
*/
@SuppressWarnings("serial")
Expand Down Expand Up @@ -93,14 +94,20 @@ public boolean isCandidateClass(Class<?> targetClass) {
}

Collection<CacheOperation> ops = new ArrayList<>(1);
annotations.stream().filter(Cacheable.class::isInstance).map(Cacheable.class::cast).forEach(
cacheable -> ops.add(parseCacheableAnnotation(ae, cachingConfig, cacheable)));
annotations.stream().filter(CacheEvict.class::isInstance).map(CacheEvict.class::cast).forEach(
cacheEvict -> ops.add(parseEvictAnnotation(ae, cachingConfig, cacheEvict)));
annotations.stream().filter(CachePut.class::isInstance).map(CachePut.class::cast).forEach(
cachePut -> ops.add(parsePutAnnotation(ae, cachingConfig, cachePut)));
annotations.stream().filter(Caching.class::isInstance).map(Caching.class::cast).forEach(
caching -> parseCachingAnnotation(ae, cachingConfig, caching, ops));
for (Annotation annotation : annotations) {
if (annotation instanceof Cacheable cacheable) {
ops.add(parseCacheableAnnotation(ae, cachingConfig, cacheable));
}
if (annotation instanceof CacheEvict cacheEvict) {
ops.add(parseEvictAnnotation(ae, cachingConfig, cacheEvict));
}
if (annotation instanceof CachePut cachePut) {
ops.add(parsePutAnnotation(ae, cachingConfig, cachePut));
}
if (annotation instanceof Caching caching) {
parseCachingAnnotation(ae, cachingConfig, caching, ops);
}
}
return ops;
}

Expand Down
Loading