diff --git a/build.gradle b/build.gradle index 7763df2eb2..828b5159f2 100644 --- a/build.gradle +++ b/build.gradle @@ -458,7 +458,7 @@ project("spring-beans-groovy") { optional("org.codehaus.groovy:groovy-all:${groovyVersion}") } - // this module's Java and Groovy sources need to be compiled together + // This module's Java and Groovy sources need to be compiled together. compileJava.enabled = false sourceSets { main { diff --git a/spring-core/src/main/java/org/springframework/util/StringUtils.java b/spring-core/src/main/java/org/springframework/util/StringUtils.java index dd73dbfe8d..cc23d0daa6 100644 --- a/spring-core/src/main/java/org/springframework/util/StringUtils.java +++ b/spring-core/src/main/java/org/springframework/util/StringUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/incrementer/MySQLMaxValueIncrementer.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/incrementer/MySQLMaxValueIncrementer.java index 5b33cb9bc7..09c984f031 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/incrementer/MySQLMaxValueIncrementer.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/incrementer/MySQLMaxValueIncrementer.java @@ -34,7 +34,7 @@ import org.springframework.jdbc.support.JdbcUtils; * *

The sequence is kept in a table; there should be one sequence table per * table that needs an auto-generated key. The storage engine used by the sequence table - * can be MYISAM or INNODB since the sequences are allocated using a separate connection + * can be MYISAM or INNODB since the sequences are allocated using a separate connection * without being affected by any other transactions that might be in progress. * *

Example: @@ -47,7 +47,7 @@ import org.springframework.jdbc.support.JdbcUtils; * database. If the server or your application is stopped or crashes or a transaction * is rolled back, the unused values will never be served. The maximum hole size in * numbering is consequently the value of cacheSize. - * + * *

It is possible to avoid acquiring a new connection for the incrementer by setting the * "useNewConnection" property to false. In this case you MUST use a non-transactional * storage engine like MYISAM when defining the incrementer table. diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSession.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSession.java index 4ab378ad8f..4138ce54b2 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSession.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -19,20 +19,23 @@ package org.springframework.messaging.simp.user; import java.util.HashSet; import java.util.Set; - +/** + * @author Rossen Stoyanchev + */ public class TestSimpSession implements SimpSession { - private String id; + private final String id; private TestSimpUser user; - private Set subscriptions = new HashSet<>(); + private final Set subscriptions = new HashSet<>(); public TestSimpSession(String id) { this.id = id; } + @Override public String getId() { return id; @@ -59,6 +62,7 @@ public class TestSimpSession implements SimpSession { } } + @Override public boolean equals(Object other) { return (this == other || (other instanceof SimpSession && this.id.equals(((SimpSession) other).getId()))); diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSubscription.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSubscription.java index 5a13c23453..94a0e0d4b6 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSubscription.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -13,25 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.messaging.simp.user; +package org.springframework.messaging.simp.user; import org.springframework.util.ObjectUtils; +/** + * @author Rossen Stoyanchev + */ public class TestSimpSubscription implements SimpSubscription { - private String id; + private final String destination; + + private final String id; private TestSimpSession session; - private String destination; - public TestSimpSubscription(String id, String destination) { this.destination = destination; this.id = id; } + @Override public String getId() { return id; @@ -51,6 +55,7 @@ public class TestSimpSubscription implements SimpSubscription { return destination; } + @Override public boolean equals(Object other) { if (this == other) { diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpUser.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpUser.java index 1607c20197..eff57f97dc 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpUser.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2017 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. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.messaging.simp.user; import java.util.HashMap; @@ -20,18 +21,21 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; - +/** + * @author Rossen Stoyanchev + */ public class TestSimpUser implements SimpUser { - private String name; + private final String name; - private Map sessions = new HashMap<>(); + private final Map sessions = new HashMap<>(); public TestSimpUser(String name) { this.name = name; } + @Override public String getName() { return name; @@ -59,6 +63,7 @@ public class TestSimpUser implements SimpUser { } } + @Override public boolean equals(Object other) { return (this == other || (other instanceof SimpUser && this.name.equals(((SimpUser) other).getName()))); diff --git a/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java b/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java index 00204a8964..c4de520e8b 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java +++ b/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java @@ -541,10 +541,10 @@ public class MockHttpServletRequest implements HttpServletRequest { for (String key : params.keySet()) { Object value = params.get(key); if (value instanceof String) { - this.addParameter(key, (String) value); + addParameter(key, (String) value); } else if (value instanceof String[]) { - this.addParameter(key, (String[]) value); + addParameter(key, (String[]) value); } else { throw new IllegalArgumentException("Parameter map value must be single value " + diff --git a/spring-web/src/main/java/org/springframework/http/MediaType.java b/spring-web/src/main/java/org/springframework/http/MediaType.java index 35f291e6fb..5679ba4cbd 100644 --- a/spring-web/src/main/java/org/springframework/http/MediaType.java +++ b/spring-web/src/main/java/org/springframework/http/MediaType.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. diff --git a/spring-web/src/main/java/org/springframework/http/converter/feed/RssChannelHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/feed/RssChannelHttpMessageConverter.java index 3e63976003..432a2ae5ee 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/feed/RssChannelHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/feed/RssChannelHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2017 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. diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java index 56013a1744..7699452551 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java @@ -541,10 +541,10 @@ public class MockHttpServletRequest implements HttpServletRequest { for (String key : params.keySet()) { Object value = params.get(key); if (value instanceof String) { - this.addParameter(key, (String) value); + addParameter(key, (String) value); } else if (value instanceof String[]) { - this.addParameter(key, (String[]) value); + addParameter(key, (String[]) value); } else { throw new IllegalArgumentException("Parameter map value must be single value " + diff --git a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletResponse.java b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletResponse.java index 541953c260..5c1dd308df 100644 --- a/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletResponse.java +++ b/spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -215,6 +215,7 @@ public class MockHttpServletResponse implements HttpServletResponse { return (int) this.contentLength; } + @Override public void setContentLengthLong(long contentLength) { this.contentLength = contentLength; doAddHeaderValue(CONTENT_LENGTH_HEADER, contentLength, true); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParser.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParser.java index 6db238e051..410eb31416 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParser.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/feed/AbstractRssFeedView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/feed/AbstractRssFeedView.java index 5cb5522fa9..0003ea5b51 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/feed/AbstractRssFeedView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/feed/AbstractRssFeedView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2017 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. @@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletResponse; import com.rometools.rome.feed.rss.Channel; import com.rometools.rome.feed.rss.Item; -import org.springframework.util.MimeTypeUtils; +import org.springframework.http.MediaType; /** * Abstract superclass for RSS Feed views, using the @@ -48,9 +48,10 @@ import org.springframework.util.MimeTypeUtils; public abstract class AbstractRssFeedView extends AbstractFeedView { public AbstractRssFeedView() { - setContentType(MimeTypeUtils.APPLICATION_RSS_XML_VALUE); + setContentType(MediaType.APPLICATION_RSS_XML_VALUE); } + /** * Create a new Channel instance to hold the entries. *

By default returns an RSS 2.0 channel, but the subclass can specify any channel.