Skip to content

Commit 581b2b0

Browse files
committed
Consistent static final logger declarations
(cherry picked from commit 753347e)
1 parent 4fa4886 commit 581b2b0

File tree

6 files changed

+29
-30
lines changed

6 files changed

+29
-30
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class CglibAopProxy implements AopProxy, Serializable {
9393

9494

9595
/** Logger available to subclasses; static to optimize serialization */
96-
protected final static Log logger = LogFactory.getLog(CglibAopProxy.class);
96+
protected static final Log logger = LogFactory.getLog(CglibAopProxy.class);
9797

9898
/** Keeps track of the Classes that we have validated for final methods */
9999
private static final Map<Class<?>, Boolean> validatedClasses = new WeakHashMap<Class<?>, Boolean>();
@@ -304,13 +304,13 @@ private Callback[] getCallbacks(Class<?> rootClass) throws Exception {
304304
Callback targetDispatcher = isStatic ?
305305
new StaticDispatcher(this.advised.getTargetSource().getTarget()) : new SerializableNoOp();
306306

307-
Callback[] mainCallbacks = new Callback[]{
308-
aopInterceptor, // for normal advice
309-
targetInterceptor, // invoke target without considering advice, if optimized
310-
new SerializableNoOp(), // no override for methods mapped to this
311-
targetDispatcher, this.advisedDispatcher,
312-
new EqualsInterceptor(this.advised),
313-
new HashCodeInterceptor(this.advised)
307+
Callback[] mainCallbacks = new Callback[] {
308+
aopInterceptor, // for normal advice
309+
targetInterceptor, // invoke target without considering advice, if optimized
310+
new SerializableNoOp(), // no override for methods mapped to this
311+
targetDispatcher, this.advisedDispatcher,
312+
new EqualsInterceptor(this.advised),
313+
new HashCodeInterceptor(this.advised)
314314
};
315315

316316
Callback[] callbacks;
@@ -702,6 +702,7 @@ private static class CglibMethodInvocation extends ReflectiveMethodInvocation {
702702

703703
public CglibMethodInvocation(Object proxy, Object target, Method method, Object[] arguments,
704704
Class<?> targetClass, List<Object> interceptorsAndDynamicMethodMatchers, MethodProxy methodProxy) {
705+
705706
super(proxy, target, method, arguments, targetClass, interceptorsAndDynamicMethodMatchers);
706707
this.methodProxy = methodProxy;
707708
this.publicMethod = Modifier.isPublic(method.getModifiers());
@@ -821,8 +822,7 @@ public int accept(Method method) {
821822
if (logger.isDebugEnabled()) {
822823
logger.debug("Method has advice and optimisations are enabled: " + method);
823824
}
824-
// We know that we are optimising so we can use the
825-
// FixedStaticChainInterceptors.
825+
// We know that we are optimising so we can use the FixedStaticChainInterceptors.
826826
int index = this.fixedInterceptorMap.get(key);
827827
return (index + this.fixedInterceptorOffset);
828828
}

spring-context/src/main/java/org/springframework/jmx/access/ConnectorDelegate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2015 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.
@@ -37,7 +37,7 @@
3737
*/
3838
class ConnectorDelegate {
3939

40-
private final static Log logger = LogFactory.getLog(ConnectorDelegate.class);
40+
private static final Log logger = LogFactory.getLog(ConnectorDelegate.class);
4141

4242
private JMXConnector connector;
4343

spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SubscriptionMethodReturnValueHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
*/
4949
public class SubscriptionMethodReturnValueHandler implements HandlerMethodReturnValueHandler {
5050

51-
private static Log logger = LogFactory.getLog(SubscriptionMethodReturnValueHandler.class);
51+
private static final Log logger = LogFactory.getLog(SubscriptionMethodReturnValueHandler.class);
5252

5353

5454
private final MessageSendingOperations<String> messagingTemplate;

spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketMessageBrokerStats.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 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.
@@ -32,7 +32,6 @@
3232
import org.springframework.web.socket.messaging.SubProtocolHandler;
3333
import org.springframework.web.socket.messaging.SubProtocolWebSocketHandler;
3434

35-
3635
/**
3736
* A central class for aggregating information about internal state and counters
3837
* from key infrastructure components of the setup that comes with
@@ -51,7 +50,7 @@
5150
*/
5251
public class WebSocketMessageBrokerStats {
5352

54-
private static Log logger = LogFactory.getLog(WebSocketMessageBrokerStats.class);
53+
private static final Log logger = LogFactory.getLog(WebSocketMessageBrokerStats.class);
5554

5655

5756
private SubProtocolWebSocketHandler webSocketHandler;
@@ -181,8 +180,8 @@ public String getSockJsTaskSchedulerStatsInfo() {
181180
}
182181

183182
private String getExecutorStatsInfo(Executor executor) {
184-
String s = executor.toString();
185-
return s.substring(s.indexOf("pool"), s.length() - 1);
183+
String str = executor.toString();
184+
return str.substring(str.indexOf("pool"), str.length() - 1);
186185
}
187186

188187
public String toString() {

spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/DefaultTransportRequest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*/
4646
class DefaultTransportRequest implements TransportRequest {
4747

48-
private static Log logger = LogFactory.getLog(DefaultTransportRequest.class);
48+
private static final Log logger = LogFactory.getLog(DefaultTransportRequest.class);
4949

5050

5151
private final SockJsUrlInfo sockJsUrlInfo;
@@ -72,10 +72,10 @@ class DefaultTransportRequest implements TransportRequest {
7272
public DefaultTransportRequest(SockJsUrlInfo sockJsUrlInfo, HttpHeaders handshakeHeaders,
7373
Transport transport, TransportType serverTransportType, SockJsMessageCodec codec) {
7474

75-
Assert.notNull(sockJsUrlInfo, "'sockJsUrlInfo' is required");
76-
Assert.notNull(transport, "'transport' is required");
77-
Assert.notNull(serverTransportType, "'transportType' is required");
78-
Assert.notNull(codec, "'codec' is required");
75+
Assert.notNull(sockJsUrlInfo, "SockJsUrlInfo is required");
76+
Assert.notNull(transport, "Transport is required");
77+
Assert.notNull(serverTransportType, "TransportType is required");
78+
Assert.notNull(codec, "SockJsMessageCodec is required");
7979
this.sockJsUrlInfo = sockJsUrlInfo;
8080
this.handshakeHeaders = (handshakeHeaders != null ? handshakeHeaders : new HttpHeaders());
8181
this.transport = transport;

spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/WebSocketTransport.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 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.
@@ -17,7 +17,7 @@
1717
package org.springframework.web.socket.sockjs.client;
1818

1919
import java.net.URI;
20-
import java.util.Arrays;
20+
import java.util.Collections;
2121
import java.util.List;
2222
import java.util.concurrent.atomic.AtomicInteger;
2323

@@ -47,15 +47,15 @@
4747
*/
4848
public class WebSocketTransport implements Transport, Lifecycle {
4949

50-
private static Log logger = LogFactory.getLog(WebSocketTransport.class);
50+
private static final Log logger = LogFactory.getLog(WebSocketTransport.class);
5151

5252
private final WebSocketClient webSocketClient;
5353

5454
private volatile boolean running = false;
5555

5656

5757
public WebSocketTransport(WebSocketClient webSocketClient) {
58-
Assert.notNull(webSocketClient, "'webSocketClient' is required");
58+
Assert.notNull(webSocketClient, "WebSocketClient is required");
5959
this.webSocketClient = webSocketClient;
6060
}
6161

@@ -69,7 +69,7 @@ public WebSocketClient getWebSocketClient() {
6969

7070
@Override
7171
public List<TransportType> getTransportTypes() {
72-
return Arrays.asList(TransportType.WEBSOCKET);
72+
return Collections.singletonList(TransportType.WEBSOCKET);
7373
}
7474

7575
@Override
@@ -146,7 +146,7 @@ private static class ClientSockJsWebSocketHandler extends TextWebSocketHandler {
146146

147147
private final AtomicInteger connectCount = new AtomicInteger(0);
148148

149-
private ClientSockJsWebSocketHandler(WebSocketClientSockJsSession session) {
149+
public ClientSockJsWebSocketHandler(WebSocketClientSockJsSession session) {
150150
Assert.notNull(session);
151151
this.sockJsSession = session;
152152
}
@@ -173,4 +173,4 @@ public void afterConnectionClosed(WebSocketSession webSocketSession, CloseStatus
173173
}
174174
}
175175

176-
}
176+
}

0 commit comments

Comments
 (0)