Skip to content

Commit 48064c7

Browse files
committed
Fixed identation problems
1 parent 750c381 commit 48064c7

File tree

5 files changed

+385
-331
lines changed

5 files changed

+385
-331
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
package org.springframework.cache.interceptor;
22

33
public class AsyncWrapResult {
4-
private CallBack callBack;
4+
private CallBack callBack;
55

6-
public AsyncWrapResult(CallBack callBack) {
7-
this.callBack = callBack;
8-
}
6+
public AsyncWrapResult(CallBack callBack) {
7+
this.callBack = callBack;
8+
}
99

10-
public void complete(Object value) {
11-
callBack.onValue(value);
12-
}
10+
public void complete(Object value) {
11+
callBack.onValue(value);
12+
}
1313

14-
public void error(Throwable throwable) {
15-
callBack.onError(throwable);
16-
}
14+
public void error(Throwable throwable) {
15+
callBack.onError(throwable);
16+
}
1717

18-
interface CallBack {
19-
void onValue(Object value);
18+
interface CallBack {
19+
void onValue(Object value);
2020

21-
void onError(Throwable throwable);
22-
}
21+
void onError(Throwable throwable);
22+
}
2323

2424
}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ public Object call() throws Exception {
389389
// Invoke the method if we don't have a cache hit
390390
Object originalReturnValue = invokeOperation(invoker);
391391

392-
returnValue = cacheResultWrapperManager.asyncUnwrap(originalReturnValue, new
393-
AsyncWrapResult(new AsyncWrapResult.CallBack() {
392+
returnValue = cacheResultWrapperManager.asyncUnwrap(originalReturnValue, new AsyncWrapResult(new AsyncWrapResult.CallBack() {
394393
@Override
395394
public void onValue(Object cacheValue) {
396395
updateCache(cacheValue, contexts, cachePutRequests);
@@ -412,8 +411,8 @@ private void updateCache(Object cacheValue, CacheOperationContexts contexts, Lis
412411

413412
// Process any collected put requests, either from @CachePut or a @Cacheable miss
414413
for (CachePutRequest cachePutRequest : cachePutRequests) {
415-
cachePutRequest.apply(cacheValue);
416-
}
414+
cachePutRequest.apply(cacheValue);
415+
}
417416

418417
// Process any late evictions
419418
processCacheEvicts(contexts.get(CacheEvictOperation.class), false, cacheValue);
Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,45 @@
1+
/*
2+
* Copyright 2002-2016 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package org.springframework.cache.interceptor;
217

18+
/**
19+
* Wrapper/Unwrapper, it allows to unwrap values to be cached and wraps it back
20+
* in order to be consumed.
21+
* @author Pablo Diaz-Lopez
22+
*/
323
interface CacheResultWrapper {
4-
/**
5-
* Wraps to the wrapping target class
6-
* @param value the value to wrap
7-
* @return the value wrapped
8-
*/
9-
Object wrap(Object value);
24+
/**
25+
* Wraps to the wrapping target class
26+
* @param value the value to wrap
27+
* @return the value wrapped
28+
*/
29+
Object wrap(Object value);
1030

11-
/**
12-
* Unwraps a value and returns it decorated if it needs in order to
13-
* notify the result, this will be the case if the wrapped value is not
14-
* available at the moment (it is calculated asynchronously
15-
* @param valueWrapped the value wrapped
16-
* @param asyncResult it will call it when the value it's available
17-
* @return the same value wrapped or a version decorated.
18-
*/
19-
Object unwrap(Object valueWrapped, AsyncWrapResult asyncResult);
31+
/**
32+
* Unwraps a value and returns it decorated if it needs in order to
33+
* notify the result, this will be the case if the wrapped value is not
34+
* available at the moment (it is calculated asynchronously
35+
* @param valueWrapped the value wrapped
36+
* @param asyncResult it will call it when the value it's available
37+
* @return the same value wrapped or a version decorated.
38+
*/
39+
Object unwrap(Object valueWrapped, AsyncWrapResult asyncResult);
2040

21-
Class<?> getWrapClass();
41+
/**
42+
* @return The target class the Wrapper can handle
43+
*/
44+
Class<?> getWrapClass();
2245
}

0 commit comments

Comments
 (0)