Skip to content

Commit 35e247a

Browse files
committed
Polishing
1 parent 67ba187 commit 35e247a

File tree

6 files changed

+24
-16
lines changed

6 files changed

+24
-16
lines changed

spring-messaging/src/main/java/org/springframework/messaging/simp/user/MultiServerUserRegistry.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void purgeExpiredRegistries() {
174174

175175
@Override
176176
public String toString() {
177-
return "local=[" + this.localRegistry + "], remote=" + this.remoteRegistries + "]";
177+
return "local=[" + this.localRegistry + "], remote=" + this.remoteRegistries;
178178
}
179179

180180

@@ -260,7 +260,6 @@ public String toString() {
260260
/**
261261
* SimpUser that can be (de)serialized and broadcast to other servers.
262262
*/
263-
@SuppressWarnings("unused")
264263
private static class TransferSimpUser implements SimpUser {
265264

266265
private String name;
@@ -274,6 +273,7 @@ private static class TransferSimpUser implements SimpUser {
274273
/**
275274
* Default constructor for JSON deserialization.
276275
*/
276+
@SuppressWarnings("unused")
277277
public TransferSimpUser() {
278278
this.sessions = new HashSet<TransferSimpSession>(1);
279279
}
@@ -368,7 +368,6 @@ public String toString() {
368368
/**
369369
* SimpSession that can be (de)serialized and broadcast to other servers.
370370
*/
371-
@SuppressWarnings("unused")
372371
private static class TransferSimpSession implements SimpSession {
373372

374373
private String id;
@@ -380,6 +379,7 @@ private static class TransferSimpSession implements SimpSession {
380379
/**
381380
* Default constructor for JSON deserialization.
382381
*/
382+
@SuppressWarnings("unused")
383383
public TransferSimpSession() {
384384
this.subscriptions = new HashSet<TransferSimpSubscription>(4);
385385
}

spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,12 @@ private void executeSqlScripts(TestContext testContext, ExecutionPhase execution
146146
/**
147147
* Execute the SQL scripts configured via the supplied {@link Sql @Sql}
148148
* annotation for the given {@link ExecutionPhase} and {@link TestContext}.
149-
*
150149
* <p>Special care must be taken in order to properly support the configured
151150
* {@link SqlConfig#transactionMode}.
152-
*
153151
* @param sql the {@code @Sql} annotation to parse
154152
* @param executionPhase the current execution phase
155153
* @param testContext the current {@code TestContext}
156-
* @param classLevel {@code true} if {@link Sql @Sql} was declared at the
157-
* class level
154+
* @param classLevel {@code true} if {@link Sql @Sql} was declared at the class level
158155
*/
159156
private void executeSqlScripts(Sql sql, ExecutionPhase executionPhase, TestContext testContext, boolean classLevel)
160157
throws Exception {

spring-test/src/main/java/org/springframework/test/context/support/ActiveProfilesUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 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.
@@ -86,7 +86,7 @@ static String[] resolveActiveProfiles(Class<?> testClass) {
8686
ActiveProfiles annotation = descriptor.synthesizeAnnotation();
8787

8888
if (logger.isTraceEnabled()) {
89-
logger.trace(String.format("Retrieved @ActiveProfiles [%s] for declaring class [%s].",
89+
logger.trace(String.format("Retrieved @ActiveProfiles [%s] for declaring class [%s]",
9090
annotation, declaringClass.getName()));
9191
}
9292

@@ -101,15 +101,15 @@ static String[] resolveActiveProfiles(Class<?> testClass) {
101101
}
102102
catch (Exception ex) {
103103
String msg = String.format("Could not instantiate ActiveProfilesResolver of type [%s] " +
104-
"for test class [%s].", resolverClass.getName(), rootDeclaringClass.getName());
104+
"for test class [%s]", resolverClass.getName(), rootDeclaringClass.getName());
105105
logger.error(msg);
106106
throw new IllegalStateException(msg, ex);
107107
}
108108

109109
String[] profiles = resolver.resolve(rootDeclaringClass);
110110
if (profiles == null) {
111111
String msg = String.format(
112-
"ActiveProfilesResolver [%s] returned a null array of bean definition profiles.",
112+
"ActiveProfilesResolver [%s] returned a null array of bean definition profiles",
113113
resolverClass.getName());
114114
logger.error(msg);
115115
throw new IllegalStateException(msg);

spring-test/src/main/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilder.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public MockHttpServletRequestBuilder contentType(String contentType) {
243243
* @param mediaTypes one or more media types
244244
*/
245245
public MockHttpServletRequestBuilder accept(MediaType... mediaTypes) {
246-
Assert.notEmpty(mediaTypes, "No 'Accept' media types");
246+
Assert.notEmpty(mediaTypes, "'mediaTypes' must not be empty");
247247
this.headers.set("Accept", MediaType.toString(Arrays.asList(mediaTypes)));
248248
return this;
249249
}
@@ -253,7 +253,7 @@ public MockHttpServletRequestBuilder accept(MediaType... mediaTypes) {
253253
* @param mediaTypes one or more media types
254254
*/
255255
public MockHttpServletRequestBuilder accept(String... mediaTypes) {
256-
Assert.notEmpty(mediaTypes, "No 'Accept' media types");
256+
Assert.notEmpty(mediaTypes, "'mediaTypes' must not be empty");
257257
List<MediaType> result = new ArrayList<MediaType>(mediaTypes.length);
258258
for (String mediaType : mediaTypes) {
259259
result.add(MediaType.parseMediaType(mediaType));
@@ -285,7 +285,6 @@ public MockHttpServletRequestBuilder content(String content) {
285285
* @param cookies the cookies to add
286286
*/
287287
public MockHttpServletRequestBuilder cookie(Cookie... cookies) {
288-
Assert.notNull(cookies, "'cookies' must not be null");
289288
Assert.notEmpty(cookies, "'cookies' must not be empty");
290289
this.cookies.addAll(Arrays.asList(cookies));
291290
return this;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private boolean isCompatibleWithConditionalRequests(HttpServletResponse response
288288
}
289289
return HttpStatus.valueOf(response.getStatus()).is2xxSuccessful();
290290
}
291-
catch (IllegalArgumentException e) {
291+
catch (IllegalArgumentException ex) {
292292
return true;
293293
}
294294
}

spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.java

Lines changed: 13 additions & 1 deletion
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-2016 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.
@@ -62,10 +62,22 @@ public class ResourceHandlerRegistry {
6262
private int order = Integer.MAX_VALUE -1;
6363

6464

65+
/**
66+
* Create a new resource handler registry for the given application context.
67+
* @param applicationContext the Spring application context
68+
* @param servletContext the corresponding Servlet context
69+
*/
6570
public ResourceHandlerRegistry(ApplicationContext applicationContext, ServletContext servletContext) {
6671
this(applicationContext, servletContext, null);
6772
}
6873

74+
/**
75+
* Create a new resource handler registry for the given application context.
76+
* @param applicationContext the Spring application context
77+
* @param servletContext the corresponding Servlet context
78+
* @param contentNegotiationManager the content negotiation manager to use
79+
* @since 4.3
80+
*/
6981
public ResourceHandlerRegistry(ApplicationContext applicationContext, ServletContext servletContext,
7082
ContentNegotiationManager contentNegotiationManager) {
7183

0 commit comments

Comments
 (0)