Skip to content

Commit 11f1e85

Browse files
committed
import order
1 parent aa4013e commit 11f1e85

File tree

5 files changed

+36
-43
lines changed

5 files changed

+36
-43
lines changed

spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,19 @@
1616

1717
package org.springframework.cache.interceptor;
1818

19+
import java.lang.reflect.Method;
20+
import java.util.ArrayList;
21+
import java.util.Collection;
22+
import java.util.Collections;
23+
import java.util.LinkedList;
24+
import java.util.List;
25+
import java.util.Map;
26+
import java.util.concurrent.Callable;
27+
import java.util.concurrent.ConcurrentHashMap;
28+
1929
import org.apache.commons.logging.Log;
2030
import org.apache.commons.logging.LogFactory;
31+
2132
import org.springframework.aop.framework.AopProxyUtils;
2233
import org.springframework.beans.factory.BeanFactory;
2334
import org.springframework.beans.factory.BeanFactoryAware;
@@ -39,16 +50,6 @@
3950
import org.springframework.util.ObjectUtils;
4051
import org.springframework.util.StringUtils;
4152

42-
import java.lang.reflect.Method;
43-
import java.util.ArrayList;
44-
import java.util.Collection;
45-
import java.util.Collections;
46-
import java.util.LinkedList;
47-
import java.util.List;
48-
import java.util.Map;
49-
import java.util.concurrent.Callable;
50-
import java.util.concurrent.ConcurrentHashMap;
51-
5253
/**
5354
* Base class for caching aspects, such as the {@link CacheInterceptor}
5455
* or an AspectJ aspect.
@@ -332,7 +333,7 @@ private Class<?> getTargetClass(Object target) {
332333
return targetClass;
333334
}
334335

335-
private Object execute(final CacheOperationInvoker invoker, Method method, final CacheOperationContexts contexts) {
336+
private Object execute(final CacheOperationInvoker invoker, Method method, CacheOperationContexts contexts) {
336337
// Special handling of synchronized invocation
337338
if (contexts.isSynchronized()) {
338339
CacheOperationContext context = contexts.get(CacheableOperation.class).iterator().next();
@@ -368,7 +369,7 @@ public Object call() throws Exception {
368369
Cache.ValueWrapper cacheHit = findCachedItem(contexts.get(CacheableOperation.class));
369370

370371
// Collect puts from any @Cacheable miss, if no cached item is found
371-
final List<CachePutRequest> cachePutRequests = new LinkedList<>();
372+
List<CachePutRequest> cachePutRequests = new LinkedList<>();
372373
if (cacheHit == null) {
373374
collectPutRequests(contexts.get(CacheableOperation.class),
374375
CacheOperationExpressionEvaluator.NO_RESULT, cachePutRequests);
@@ -395,7 +396,7 @@ public void onValue(Object cacheValue) {
395396

396397
@Override
397398
public void onError(Throwable throwable) {
398-
// Nothing to do, I think...
399+
// Exceptions are not cached
399400
}
400401
}));
401402
}
@@ -409,7 +410,7 @@ private void updateCache(Object cacheValue, CacheOperationContexts contexts, Lis
409410

410411
// Process any collected put requests, either from @CachePut or a @Cacheable miss
411412
for (CachePutRequest cachePutRequest : cachePutRequests) {
412-
cachePutRequest.apply(cacheValue);
413+
cachePutRequest.apply(cacheValue);
413414
}
414415

415416
// Process any late evictions

spring-context/src/main/java/org/springframework/cache/interceptor/CacheResultWrapperManager.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,20 @@
1515
*/
1616
package org.springframework.cache.interceptor;
1717

18+
import java.util.HashMap;
19+
import java.util.Map;
20+
import java.util.Optional;
21+
import java.util.function.Supplier;
22+
23+
import reactor.core.publisher.Mono;
24+
25+
import rx.Single;
26+
1827
import org.springframework.core.ReactiveAdapter;
1928
import org.springframework.core.ReactiveAdapterRegistry;
2029
import org.springframework.util.ClassUtils;
2130
import org.springframework.util.ObjectUtils;
22-
import reactor.core.publisher.Mono;
23-
import rx.Single;
2431

25-
import java.util.HashMap;
26-
import java.util.Map;
27-
import java.util.Optional;
28-
import java.util.function.Supplier;
2932

3033
/**
3134
* Manages the {@link CacheResultWrapper} instances to apply only the appropriate.

spring-context/src/test/java/org/springframework/cache/CacheRxJavaTests.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,24 @@
1616

1717
package org.springframework.cache;
1818

19+
import static org.junit.Assert.*;
20+
1921
import org.junit.Before;
2022
import org.junit.Ignore;
2123
import org.junit.Test;
24+
25+
import rx.Observable;
26+
import rx.Single;
27+
import rx.observers.TestSubscriber;
28+
2229
import org.springframework.cache.annotation.Cacheable;
2330
import org.springframework.cache.annotation.EnableCaching;
2431
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
2532
import org.springframework.cache.interceptor.SimpleKey;
2633
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
2734
import org.springframework.context.annotation.Bean;
2835
import org.springframework.context.annotation.Configuration;
29-
import rx.Observable;
30-
import rx.Single;
31-
import rx.observers.TestSubscriber;
3236

33-
import static org.junit.Assert.*;
3437

3538
/**
3639
* Tests to check RxJava support.

spring-context/src/test/java/org/springframework/cache/ReactorTests.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@
1616

1717
package org.springframework.cache;
1818

19+
import static org.junit.Assert.*;
20+
1921
import org.junit.Before;
2022
import org.junit.Test;
23+
24+
import reactor.core.publisher.Mono;
25+
2126
import org.springframework.cache.annotation.Cacheable;
2227
import org.springframework.cache.annotation.EnableCaching;
2328
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
@@ -26,9 +31,7 @@
2631
import org.springframework.context.annotation.Bean;
2732
import org.springframework.context.annotation.Configuration;
2833
import org.springframework.tests.TestSubscriber;
29-
import reactor.core.publisher.Mono;
3034

31-
import static org.junit.Assert.*;
3235

3336
/**
3437
* Tests to check RxJava support.

spring-core/src/main/java/org/springframework/lang/UsesRxJava.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)