diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/user/MultiServerUserRegistry.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/user/MultiServerUserRegistry.java index 65d3333907a..bdfb9112b64 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/user/MultiServerUserRegistry.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/user/MultiServerUserRegistry.java @@ -174,7 +174,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati @Override public String toString() { - return "local=[" + this.localRegistry + "], remote=" + this.remoteRegistries + "]"; + return "local=[" + this.localRegistry + "], remote=" + this.remoteRegistries; } @@ -260,7 +260,6 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati /** * SimpUser that can be (de)serialized and broadcast to other servers. */ - @SuppressWarnings("unused") private static class TransferSimpUser implements SimpUser { private String name; @@ -274,6 +273,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati /** * Default constructor for JSON deserialization. */ + @SuppressWarnings("unused") public TransferSimpUser() { this.sessions = new HashSet(1); } @@ -368,7 +368,6 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati /** * SimpSession that can be (de)serialized and broadcast to other servers. */ - @SuppressWarnings("unused") private static class TransferSimpSession implements SimpSession { private String id; @@ -380,6 +379,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati /** * Default constructor for JSON deserialization. */ + @SuppressWarnings("unused") public TransferSimpSession() { this.subscriptions = new HashSet(4); } diff --git a/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java b/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java index 675c0e24b10..6c7c428f621 100644 --- a/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java +++ b/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java @@ -146,15 +146,12 @@ public class SqlScriptsTestExecutionListener extends AbstractTestExecutionListen /** * Execute the SQL scripts configured via the supplied {@link Sql @Sql} * annotation for the given {@link ExecutionPhase} and {@link TestContext}. - * *

Special care must be taken in order to properly support the configured * {@link SqlConfig#transactionMode}. - * * @param sql the {@code @Sql} annotation to parse * @param executionPhase the current execution phase * @param testContext the current {@code TestContext} - * @param classLevel {@code true} if {@link Sql @Sql} was declared at the - * class level + * @param classLevel {@code true} if {@link Sql @Sql} was declared at the class level */ private void executeSqlScripts(Sql sql, ExecutionPhase executionPhase, TestContext testContext, boolean classLevel) throws Exception { diff --git a/spring-test/src/main/java/org/springframework/test/context/support/ActiveProfilesUtils.java b/spring-test/src/main/java/org/springframework/test/context/support/ActiveProfilesUtils.java index 5054f9bed8e..b9b242b60c3 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/ActiveProfilesUtils.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/ActiveProfilesUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,7 +86,7 @@ abstract class ActiveProfilesUtils { ActiveProfiles annotation = descriptor.synthesizeAnnotation(); if (logger.isTraceEnabled()) { - logger.trace(String.format("Retrieved @ActiveProfiles [%s] for declaring class [%s].", + logger.trace(String.format("Retrieved @ActiveProfiles [%s] for declaring class [%s]", annotation, declaringClass.getName())); } @@ -101,7 +101,7 @@ abstract class ActiveProfilesUtils { } catch (Exception ex) { String msg = String.format("Could not instantiate ActiveProfilesResolver of type [%s] " + - "for test class [%s].", resolverClass.getName(), rootDeclaringClass.getName()); + "for test class [%s]", resolverClass.getName(), rootDeclaringClass.getName()); logger.error(msg); throw new IllegalStateException(msg, ex); } @@ -109,7 +109,7 @@ abstract class ActiveProfilesUtils { String[] profiles = resolver.resolve(rootDeclaringClass); if (profiles == null) { String msg = String.format( - "ActiveProfilesResolver [%s] returned a null array of bean definition profiles.", + "ActiveProfilesResolver [%s] returned a null array of bean definition profiles", resolverClass.getName()); logger.error(msg); throw new IllegalStateException(msg); diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilder.java b/spring-test/src/main/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilder.java index d181a46fe78..cff0d2c1a79 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilder.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilder.java @@ -243,7 +243,7 @@ public class MockHttpServletRequestBuilder * @param mediaTypes one or more media types */ public MockHttpServletRequestBuilder accept(MediaType... mediaTypes) { - Assert.notEmpty(mediaTypes, "No 'Accept' media types"); + Assert.notEmpty(mediaTypes, "'mediaTypes' must not be empty"); this.headers.set("Accept", MediaType.toString(Arrays.asList(mediaTypes))); return this; } @@ -253,7 +253,7 @@ public class MockHttpServletRequestBuilder * @param mediaTypes one or more media types */ public MockHttpServletRequestBuilder accept(String... mediaTypes) { - Assert.notEmpty(mediaTypes, "No 'Accept' media types"); + Assert.notEmpty(mediaTypes, "'mediaTypes' must not be empty"); List result = new ArrayList(mediaTypes.length); for (String mediaType : mediaTypes) { result.add(MediaType.parseMediaType(mediaType)); @@ -285,7 +285,6 @@ public class MockHttpServletRequestBuilder * @param cookies the cookies to add */ public MockHttpServletRequestBuilder cookie(Cookie... cookies) { - Assert.notNull(cookies, "'cookies' must not be null"); Assert.notEmpty(cookies, "'cookies' must not be empty"); this.cookies.addAll(Arrays.asList(cookies)); return this; diff --git a/spring-web/src/main/java/org/springframework/web/context/request/ServletWebRequest.java b/spring-web/src/main/java/org/springframework/web/context/request/ServletWebRequest.java index 97a227af112..096d216a4fb 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/ServletWebRequest.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/ServletWebRequest.java @@ -288,7 +288,7 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ } return HttpStatus.valueOf(response.getStatus()).is2xxSuccessful(); } - catch (IllegalArgumentException e) { + catch (IllegalArgumentException ex) { return true; } } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.java index abf714753c1..81f04456e0d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,10 +62,22 @@ public class ResourceHandlerRegistry { private int order = Integer.MAX_VALUE -1; + /** + * Create a new resource handler registry for the given application context. + * @param applicationContext the Spring application context + * @param servletContext the corresponding Servlet context + */ public ResourceHandlerRegistry(ApplicationContext applicationContext, ServletContext servletContext) { this(applicationContext, servletContext, null); } + /** + * Create a new resource handler registry for the given application context. + * @param applicationContext the Spring application context + * @param servletContext the corresponding Servlet context + * @param contentNegotiationManager the content negotiation manager to use + * @since 4.3 + */ public ResourceHandlerRegistry(ApplicationContext applicationContext, ServletContext servletContext, ContentNegotiationManager contentNegotiationManager) {