Skip to content

Commit d1551bd

Browse files
committed
Polishing
1 parent 470ea97 commit d1551bd

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ public static String getShortName(Class<?> clazz) {
428428
* @see java.beans.Introspector#decapitalize(String)
429429
*/
430430
public static String getShortNameAsProperty(Class<?> clazz) {
431-
String shortName = ClassUtils.getShortName(clazz);
431+
String shortName = getShortName(clazz);
432432
int dotIndex = shortName.lastIndexOf(PACKAGE_SEPARATOR);
433433
shortName = (dotIndex != -1 ? shortName.substring(dotIndex + 1) : shortName);
434434
return Introspector.decapitalize(shortName);
@@ -498,7 +498,7 @@ private static String getQualifiedNameForArray(Class<?> clazz) {
498498
StringBuilder result = new StringBuilder();
499499
while (clazz.isArray()) {
500500
clazz = clazz.getComponentType();
501-
result.append(ClassUtils.ARRAY_SUFFIX);
501+
result.append(ARRAY_SUFFIX);
502502
}
503503
result.insert(0, clazz.getName());
504504
return result.toString();
@@ -1222,7 +1222,7 @@ public static boolean isVisible(Class<?> clazz, ClassLoader classLoader) {
12221222
* @see org.springframework.aop.support.AopUtils#isCglibProxy(Object)
12231223
*/
12241224
public static boolean isCglibProxy(Object object) {
1225-
return ClassUtils.isCglibProxyClass(object.getClass());
1225+
return isCglibProxyClass(object.getClass());
12261226
}
12271227

12281228
/**

spring-websocket/src/main/java/org/springframework/web/socket/server/standard/UndertowRequestUpgradeStrategy.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,20 @@
6060
import org.springframework.util.ReflectionUtils;
6161
import org.springframework.web.socket.server.HandshakeFailureException;
6262

63-
6463
/**
65-
* RequestUpgradeStrategy for WildFly and its underlying Undertow web
66-
* server. Also compatible with embedded Undertow usage.
64+
* A WebSocket {@code RequestUpgradeStrategy} for WildFly and its underlying
65+
* Undertow web server. Also compatible with embedded Undertow usage.
6766
*
68-
* <p>Compatible with Undertow 1.0 to 1.3 and also 1.3.5+ - as included in
69-
* WildFly 8.x, 9 and 10.
67+
* <p>Designed for Undertow 1.3.5+ as of Spring Framework 4.3, with a fallback
68+
* strategy for Undertow 1.0 to 1.3 - as included in WildFly 8.x, 9 and 10.
7069
*
7170
* @author Rossen Stoyanchev
7271
* @since 4.0.1
7372
*/
7473
public class UndertowRequestUpgradeStrategy extends AbstractStandardUpgradeStrategy {
7574

76-
private static final boolean HAS_DO_UPGRADE = ClassUtils.hasMethod(ServerWebSocketContainer.class,
77-
"doUpgrade", (Class<?>[]) null);
75+
private static final boolean HAS_DO_UPGRADE = ClassUtils.hasMethod(ServerWebSocketContainer.class, "doUpgrade",
76+
HttpServletRequest.class, HttpServletResponse.class, ServerEndpointConfig.class, Map.class);
7877

7978
private static final FallbackStrategy FALLBACK_STRATEGY = (HAS_DO_UPGRADE ? null : new FallbackStrategy());
8079

@@ -108,8 +107,7 @@ protected void upgradeInternal(ServerHttpRequest request, ServerHttpResponse res
108107
endpointConfig.setExtensions(selectedExtensions);
109108

110109
try {
111-
getContainer(servletRequest).doUpgrade(servletRequest, servletResponse,
112-
endpointConfig, pathParams);
110+
getContainer(servletRequest).doUpgrade(servletRequest, servletResponse, endpointConfig, pathParams);
113111
}
114112
catch (ServletException ex) {
115113
throw new HandshakeFailureException(
@@ -121,8 +119,7 @@ protected void upgradeInternal(ServerHttpRequest request, ServerHttpResponse res
121119
}
122120
}
123121
else {
124-
FALLBACK_STRATEGY.upgradeInternal(request, response, selectedProtocol,
125-
selectedExtensions, endpoint);
122+
FALLBACK_STRATEGY.upgradeInternal(request, response, selectedProtocol, selectedExtensions, endpoint);
126123
}
127124
}
128125

@@ -195,10 +192,8 @@ private static class FallbackStrategy extends AbstractStandardUpgradeStrategy {
195192
}
196193
}
197194

198-
199195
private final Set<WebSocketChannel> peerConnections;
200196

201-
202197
public FallbackStrategy() {
203198
if (exchangeConstructorWithPeerConnections) {
204199
this.peerConnections = Collections.newSetFromMap(new ConcurrentHashMap<WebSocketChannel, Boolean>());
@@ -208,7 +203,6 @@ public FallbackStrategy() {
208203
}
209204
}
210205

211-
212206
@Override
213207
public String[] getSupportedVersions() {
214208
return VERSIONS;

0 commit comments

Comments
 (0)