Skip to content

Commit 20c2ba3

Browse files
committed
Polishing
1 parent c6d29f1 commit 20c2ba3

File tree

24 files changed

+439
-601
lines changed

24 files changed

+439
-601
lines changed

spring-aspects/src/main/java/org/springframework/cache/aspectj/JCacheCacheAspect.aj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public aspect JCacheCacheAspect extends JCacheAspectSupport {
6363

6464
};
6565

66-
6766
try {
6867
return execute(aspectJInvoker, thisJoinPoint.getTarget(), method, thisJoinPoint.getArgs());
6968
}

spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.springframework.beans.factory.config;
1818

1919
import java.io.IOException;
20-
import java.util.ArrayList;
2120
import java.util.Arrays;
2221
import java.util.Collection;
2322
import java.util.Collections;
@@ -83,8 +82,7 @@ public abstract class YamlProcessor {
8382
* @param matchers a map of keys to value patterns (regular expressions)
8483
*/
8584
public void setDocumentMatchers(DocumentMatcher... matchers) {
86-
this.documentMatchers = Collections
87-
.unmodifiableList(new ArrayList<DocumentMatcher>(Arrays.asList(matchers)));
85+
this.documentMatchers = Arrays.asList(matchers);
8886
}
8987

9088
/**
@@ -114,7 +112,7 @@ public void setResolutionMethod(ResolutionMethod resolutionMethod) {
114112
* @see ResolutionMethod
115113
*/
116114
public void setResources(Resource... resources) {
117-
this.resources = (resources == null ? null : resources.clone());
115+
this.resources = resources;
118116
}
119117

120118

@@ -152,8 +150,8 @@ private boolean process(MatchCallback callback, Yaml yaml, Resource resource) {
152150
}
153151
}
154152
if (this.logger.isDebugEnabled()) {
155-
this.logger.debug("Loaded " + count + " document"
156-
+ (count > 1 ? "s" : "") + " from YAML resource: " + resource);
153+
this.logger.debug("Loaded " + count + " document" + (count > 1 ? "s" : "") +
154+
" from YAML resource: " + resource);
157155
}
158156
}
159157
catch (IOException ex) {
@@ -218,8 +216,7 @@ private boolean process(Map<String, Object> map, MatchCallback callback) {
218216
result = MatchStatus.getMostSpecific(match, result);
219217
if (match == MatchStatus.FOUND) {
220218
if (this.logger.isDebugEnabled()) {
221-
this.logger.debug("Matched document with document matcher: "
222-
+ properties);
219+
this.logger.debug("Matched document with document matcher: " + properties);
223220
}
224221
callback.process(properties, map);
225222
return true;
@@ -328,7 +325,7 @@ public static enum MatchStatus {
328325
* Compare two {@link MatchStatus} items, returning the most specific status.
329326
*/
330327
public static MatchStatus getMostSpecific(MatchStatus a, MatchStatus b) {
331-
return a.ordinal() < b.ordinal() ? a : b;
328+
return (a.ordinal() < b.ordinal() ? a : b);
332329
}
333330
}
334331

spring-context/src/main/java/org/springframework/cache/annotation/CachingConfigurerSupport.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ public CacheResolver cacheResolver() {
5050
public CacheErrorHandler errorHandler() {
5151
return null;
5252
}
53+
5354
}

spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ protected Executor getTaskExecutor() {
9696
* and logs exceptions (a la
9797
* {@link org.springframework.scheduling.support.TaskUtils#LOG_AND_SUPPRESS_ERROR_HANDLER})
9898
* or an implementation that logs exceptions while nevertheless propagating them
99-
* (e.g.,
100-
* {@link org.springframework.scheduling.support.TaskUtils#LOG_AND_PROPAGATE_ERROR_HANDLER}).
99+
* (e.g. {@link org.springframework.scheduling.support.TaskUtils#LOG_AND_PROPAGATE_ERROR_HANDLER}).
101100
* @since 4.1
102101
*/
103102
public void setErrorHandler(ErrorHandler errorHandler) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
* @see #setBeforeExistingAdvisors
5757
*/
5858
@SuppressWarnings("serial")
59-
public class AsyncAnnotationBeanPostProcessor extends AbstractAdvisingBeanPostProcessor
60-
implements BeanFactoryAware {
59+
public class AsyncAnnotationBeanPostProcessor extends AbstractAdvisingBeanPostProcessor implements BeanFactoryAware {
6160

6261
private Class<? extends Annotation> asyncAnnotationType;
6362

@@ -70,6 +69,7 @@ public AsyncAnnotationBeanPostProcessor() {
7069
setBeforeExistingAdvisors(true);
7170
}
7271

72+
7373
/**
7474
* Set the 'async' annotation type to be detected at either class or method
7575
* level. By default, both the {@link Async} annotation and the EJB 3.1

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ public Executor getAsyncExecutor() {
3939
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
4040
return null;
4141
}
42+
4243
}

spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ static class Config {
150150

151151
@Target(ElementType.TYPE)
152152
@Retention(RetentionPolicy.RUNTIME)
153-
@Import({ DeferredImportSelector1.class, DeferredImportSelector2.class,
154-
ImportSelector1.class, ImportSelector2.class })
153+
@Import({DeferredImportSelector1.class, DeferredImportSelector2.class, ImportSelector1.class, ImportSelector2.class})
155154
public static @interface Sample {
156155
}
157156

spring-core/src/main/java/org/springframework/util/AntPathMatcher.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public class AntPathMatcher implements PathMatcher {
7575
* Create a new instance with the {@link #DEFAULT_PATH_SEPARATOR}.
7676
*/
7777
public AntPathMatcher() {
78-
7978
}
8079

8180
/**

spring-core/src/main/java/org/springframework/util/concurrent/FailureCallback.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public interface FailureCallback {
2727

2828
/**
2929
* Called when the {@link ListenableFuture} fails to complete.
30-
* @param t the exception that triggered the failure
30+
* @param ex the exception that triggered the failure
3131
*/
32-
void onFailure(Throwable t);
32+
void onFailure(Throwable ex);
3333

3434
}

spring-core/src/main/java/org/springframework/util/concurrent/ListenableFutureAdapter.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@
3030
* @author Arjen Poutsma
3131
* @since 4.0
3232
*/
33-
public abstract class ListenableFutureAdapter<T, S> extends FutureAdapter<T, S>
34-
implements ListenableFuture<T> {
33+
public abstract class ListenableFutureAdapter<T, S> extends FutureAdapter<T, S> implements ListenableFuture<T> {
3534

3635
/**
37-
* Constructs a new {@code ListenableFutureAdapter} with the given adaptee.
36+
* Construct a new {@code ListenableFutureAdapter} with the given adaptee.
3837
* @param adaptee the future to adaptee to
3938
*/
4039
protected ListenableFutureAdapter(ListenableFuture<S> adaptee) {
@@ -48,8 +47,7 @@ public void addCallback(final ListenableFutureCallback<? super T> callback) {
4847
}
4948

5049
@Override
51-
public void addCallback(final SuccessCallback<? super T> successCallback,
52-
final FailureCallback failureCallback) {
50+
public void addCallback(final SuccessCallback<? super T> successCallback, final FailureCallback failureCallback) {
5351
ListenableFuture<S> listenableAdaptee = (ListenableFuture<S>) getAdaptee();
5452
listenableAdaptee.addCallback(new ListenableFutureCallback<S>() {
5553
@Override
@@ -65,10 +63,9 @@ public void onSuccess(S result) {
6563
onFailure(t);
6664
}
6765
}
68-
6966
@Override
70-
public void onFailure(Throwable t) {
71-
failureCallback.onFailure(t);
67+
public void onFailure(Throwable ex) {
68+
failureCallback.onFailure(ex);
7269
}
7370
});
7471
}

0 commit comments

Comments
 (0)