Skip to content

Commit 75d751d

Browse files
committed
Polishing
1 parent 55e601c commit 75d751d

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -154,7 +154,6 @@ private void findDefinedEqualsAndHashCodeMethods(Class<?>[] proxiedInterfaces) {
154154
@Override
155155
@Nullable
156156
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
157-
MethodInvocation invocation;
158157
Object oldProxy = null;
159158
boolean setProxyContext = false;
160159

@@ -207,7 +206,8 @@ else if (!this.advised.opaque && method.getDeclaringClass().isInterface() &&
207206
}
208207
else {
209208
// We need to create a method invocation...
210-
invocation = new ReflectiveMethodInvocation(proxy, target, method, args, targetClass, chain);
209+
MethodInvocation invocation =
210+
new ReflectiveMethodInvocation(proxy, target, method, args, targetClass, chain);
211211
// Proceed to the joinpoint through the interceptor chain.
212212
retVal = invocation.proceed();
213213
}

spring-beans/src/main/java/org/springframework/beans/TypeConverterDelegate.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,7 @@ private Collection<?> convertToTypedCollection(Collection<?> original, @Nullable
522522
return original;
523523
}
524524

525-
int i = 0;
526-
for (; it.hasNext(); i++) {
525+
for (int i = 0; it.hasNext(); i++) {
527526
Object element = it.next();
528527
String indexedPropertyName = buildIndexedPropertyName(propertyName, i);
529528
Object convertedElement = convertIfNecessary(indexedPropertyName, null, element,

spring-web/src/main/java/org/springframework/web/context/request/async/DeferredResult.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
2121
import java.util.function.Consumer;
2222
import java.util.function.Supplier;
2323

24-
2524
import org.apache.commons.logging.Log;
2625
import org.apache.commons.logging.LogFactory;
2726

@@ -60,7 +59,7 @@ public class DeferredResult<T> {
6059

6160

6261
@Nullable
63-
private final Long timeout;
62+
private final Long timeoutValue;
6463

6564
private final Supplier<?> timeoutResult;
6665

@@ -89,35 +88,36 @@ public DeferredResult() {
8988
* <p>By default not set in which case the default configured in the MVC
9089
* Java Config or the MVC namespace is used, or if that's not set, then the
9190
* timeout depends on the default of the underlying server.
92-
* @param timeout timeout value in milliseconds
91+
* @param timeoutValue timeout value in milliseconds
9392
*/
94-
public DeferredResult(Long timeout) {
95-
this(timeout, () -> RESULT_NONE);
93+
public DeferredResult(Long timeoutValue) {
94+
this(timeoutValue, () -> RESULT_NONE);
9695
}
9796

9897
/**
9998
* Create a DeferredResult with a timeout value and a default result to use
10099
* in case of timeout.
101-
* @param timeout timeout value in milliseconds (ignored if {@code null})
100+
* @param timeoutValue timeout value in milliseconds (ignored if {@code null})
102101
* @param timeoutResult the result to use
103102
*/
104-
public DeferredResult(@Nullable Long timeout, final Object timeoutResult) {
103+
public DeferredResult(@Nullable Long timeoutValue, final Object timeoutResult) {
105104
this.timeoutResult = () -> timeoutResult;
106-
this.timeout = timeout;
105+
this.timeoutValue = timeoutValue;
107106
}
108107

109108
/**
110109
* Variant of {@link #DeferredResult(Long, Object)} that accepts a dynamic
111110
* fallback value based on a {@link Supplier}.
112-
* @param timeout timeout value in milliseconds (ignored if {@code null})
111+
* @param timeoutValue timeout value in milliseconds (ignored if {@code null})
113112
* @param timeoutResult the result supplier to use
114113
* @since 5.1.1
115114
*/
116-
public DeferredResult(@Nullable Long timeout, Supplier<?> timeoutResult) {
115+
public DeferredResult(@Nullable Long timeoutValue, Supplier<?> timeoutResult) {
117116
this.timeoutResult = timeoutResult;
118-
this.timeout = timeout;
117+
this.timeoutValue = timeoutValue;
119118
}
120119

120+
121121
/**
122122
* Return {@code true} if this DeferredResult is no longer usable either
123123
* because it was previously set or because the underlying request expired.
@@ -155,7 +155,7 @@ public Object getResult() {
155155
*/
156156
@Nullable
157157
final Long getTimeoutValue() {
158-
return this.timeout;
158+
return this.timeoutValue;
159159
}
160160

161161
/**

spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -354,7 +354,7 @@ public final void handleRequest(ServerHttpRequest request, ServerHttpResponse re
354354
String requestInfo = (logger.isDebugEnabled() ? request.getMethod() + " " + request.getURI() : null);
355355

356356
try {
357-
if (sockJsPath.equals("") || sockJsPath.equals("/")) {
357+
if (sockJsPath.isEmpty() || sockJsPath.equals("/")) {
358358
if (requestInfo != null) {
359359
logger.debug("Processing transport request: " + requestInfo);
360360
}

0 commit comments

Comments
 (0)