diff --git a/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java b/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java index 99d044644b1..723f31cddc5 100644 --- a/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java +++ b/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java @@ -237,6 +237,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp } Closure beans = new Closure(this) { + @Override public Object call(Object[] args) { invokeBeanDefiningClosure((Closure) args[0]); return null; @@ -818,14 +819,17 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp return retVal; } + @Override public Object invokeMethod(String name, Object args) { return InvokerHelper.invokeMethod(this.propertyValue, name, args); } + @Override public Object getProperty(String name) { return InvokerHelper.getProperty(this.propertyValue, name); } + @Override public void setProperty(String name, Object value) { InvokerHelper.setProperty(this.propertyValue, name, value); } diff --git a/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionWrapper.java b/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionWrapper.java index 4a70a42c6d2..1a93c9dc55a 100644 --- a/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionWrapper.java +++ b/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2018 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. @@ -162,6 +162,7 @@ class GroovyBeanDefinitionWrapper extends GroovyObjectSupport { } + @Override public Object getProperty(String property) { if (this.definitionWrapper.isReadableProperty(property)) { return this.definitionWrapper.getPropertyValue(property); @@ -172,6 +173,7 @@ class GroovyBeanDefinitionWrapper extends GroovyObjectSupport { return super.getProperty(property); } + @Override public void setProperty(String property, Object newValue) { if (PARENT.equals(property)) { setParent(newValue); diff --git a/spring-beans/src/main/java/org/springframework/beans/TypeMismatchException.java b/spring-beans/src/main/java/org/springframework/beans/TypeMismatchException.java index 2f81b70a418..7bc7a90113c 100644 --- a/spring-beans/src/main/java/org/springframework/beans/TypeMismatchException.java +++ b/spring-beans/src/main/java/org/springframework/beans/TypeMismatchException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -41,7 +41,7 @@ public class TypeMismatchException extends PropertyAccessException { /** - * Create a new TypeMismatchException. + * Create a new {@code TypeMismatchException}. * @param propertyChangeEvent the PropertyChangeEvent that resulted in the problem * @param requiredType the required target type */ @@ -50,7 +50,7 @@ public class TypeMismatchException extends PropertyAccessException { } /** - * Create a new TypeMismatchException. + * Create a new {@code TypeMismatchException}. * @param propertyChangeEvent the PropertyChangeEvent that resulted in the problem * @param requiredType the required target type (or {@code null} if not known) * @param cause the root cause (may be {@code null}) @@ -69,7 +69,7 @@ public class TypeMismatchException extends PropertyAccessException { } /** - * Create a new TypeMismatchException without PropertyChangeEvent. + * Create a new {@code TypeMismatchException} without a {@code PropertyChangeEvent}. * @param value the offending value that couldn't be converted (may be {@code null}) * @param requiredType the required target type (or {@code null} if not known) */ @@ -78,7 +78,7 @@ public class TypeMismatchException extends PropertyAccessException { } /** - * Create a new TypeMismatchException without PropertyChangeEvent. + * Create a new {@code TypeMismatchException} without a {@code PropertyChangeEvent}. * @param value the offending value that couldn't be converted (may be {@code null}) * @param requiredType the required target type (or {@code null} if not known) * @param cause the root cause (may be {@code null}) diff --git a/spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java b/spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java index 5e327797659..886f92c0ce7 100644 --- a/spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java +++ b/spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java @@ -489,6 +489,7 @@ public class FastByteArrayOutputStream extends OutputStream { * Update the message digest with the remaining bytes in this stream. * @param messageDigest The message digest to update */ + @Override public void updateMessageDigest(MessageDigest messageDigest) { updateMessageDigest(messageDigest, available()); } @@ -499,6 +500,7 @@ public class FastByteArrayOutputStream extends OutputStream { * @param messageDigest The message digest to update * @param len how many bytes to read from this stream and use to update the message digest */ + @Override public void updateMessageDigest(MessageDigest messageDigest, int len) { if (this.currentBuffer == null) { // This stream doesn't have any data in it... diff --git a/spring-jms/src/main/java/org/springframework/jms/support/JmsMessageHeaderAccessor.java b/spring-jms/src/main/java/org/springframework/jms/support/JmsMessageHeaderAccessor.java index 7783f237144..ba8fef961f5 100644 --- a/spring-jms/src/main/java/org/springframework/jms/support/JmsMessageHeaderAccessor.java +++ b/spring-jms/src/main/java/org/springframework/jms/support/JmsMessageHeaderAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2018 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. @@ -82,7 +82,7 @@ public class JmsMessageHeaderAccessor extends NativeMessageHeaderAccessor { } /** - * Return the {@link JmsHeaders#PRIORITY}. + * Return the {@link JmsHeaders#PRIORITY priority}. * @see JmsHeaders#PRIORITY */ public Integer getPriority() { @@ -117,6 +117,7 @@ public class JmsMessageHeaderAccessor extends NativeMessageHeaderAccessor { * Return the {@link JmsHeaders#TIMESTAMP timestamp}. * @see JmsHeaders#TIMESTAMP */ + @Override public Long getTimestamp() { return (Long) getHeader(JmsHeaders.TIMESTAMP); } diff --git a/spring-jms/src/main/java/org/springframework/jms/support/SimpleJmsHeaderMapper.java b/spring-jms/src/main/java/org/springframework/jms/support/SimpleJmsHeaderMapper.java index f32018fb2f6..99ef47ce536 100644 --- a/spring-jms/src/main/java/org/springframework/jms/support/SimpleJmsHeaderMapper.java +++ b/spring-jms/src/main/java/org/springframework/jms/support/SimpleJmsHeaderMapper.java @@ -235,6 +235,7 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper impleme *

Convert {@link MessageHeaders#CONTENT_TYPE} to {@code content_type} for JMS compliance. * @see #CONTENT_TYPE_PROPERTY */ + @Override protected String fromHeaderName(String headerName) { if (MessageHeaders.CONTENT_TYPE.equals(headerName)) { return CONTENT_TYPE_PROPERTY; @@ -247,6 +248,7 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper impleme *

Convert the JMS-compliant {@code content_type} to {@link MessageHeaders#CONTENT_TYPE}. * @see #CONTENT_TYPE_PROPERTY */ + @Override protected String toHeaderName(String propertyName) { if (CONTENT_TYPE_PROPERTY.equals(propertyName)) { return MessageHeaders.CONTENT_TYPE; diff --git a/spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5/LocalSessionFactoryBuilder.java b/spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5/LocalSessionFactoryBuilder.java index fd08c996cb7..115d017b273 100644 --- a/spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5/LocalSessionFactoryBuilder.java +++ b/spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5/LocalSessionFactoryBuilder.java @@ -88,7 +88,7 @@ public class LocalSessionFactoryBuilder extends Configuration { new AnnotationTypeFilter(Embeddable.class, false), new AnnotationTypeFilter(MappedSuperclass.class, false)}; - private final TypeFilter CONVERTER_TYPE_FILTER = new AnnotationTypeFilter(Converter.class, false); + private static final TypeFilter CONVERTER_TYPE_FILTER = new AnnotationTypeFilter(Converter.class, false); private final ResourcePatternResolver resourcePatternResolver; diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java index f46ae7c4570..d223831bfbe 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java @@ -490,6 +490,7 @@ final class HtmlUnitRequestBuilder implements RequestBuilder, Mergeable { super(servletContext, method, requestURI); } + @Override public HttpSession getSession(boolean create) { HttpSession session = super.getSession(false); if (session == null && create) { @@ -506,10 +507,12 @@ final class HtmlUnitRequestBuilder implements RequestBuilder, Mergeable { return session; } + @Override public HttpSession getSession() { return super.getSession(); } + @Override public void setSession(HttpSession session) { super.setSession(session); } @@ -535,6 +538,7 @@ final class HtmlUnitRequestBuilder implements RequestBuilder, Mergeable { this.request = request; } + @Override public void invalidate() { super.invalidate(); synchronized (HtmlUnitRequestBuilder.this.sessions) { diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriver.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriver.java index e8fc5f18443..150aaf2ac76 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriver.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriver.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. @@ -91,13 +91,14 @@ public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver { * Return the current {@link WebClient}. * @since 4.3 */ + @Override public WebClient getWebClient() { return this.webClient; } /** * Set the {@link WebConnection} to be used with the {@link WebClient}. - * @param webConnection the {@code WebConnection} to use (never {@code null}) + * @param webConnection the {@code WebConnection} to use */ public void setWebConnection(WebConnection webConnection) { Assert.notNull(webConnection, "WebConnection must not be null"); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/CompositeRequestCondition.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/CompositeRequestCondition.java index 221a9cda4eb..9db729d70cf 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/CompositeRequestCondition.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/CompositeRequestCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2018 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. @@ -69,12 +69,13 @@ public class CompositeRequestCondition extends AbstractRequestCondition> getConditions() { return unwrap(); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ConsumesRequestCondition.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ConsumesRequestCondition.java index e7a6af41e58..6ad951e59b9 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ConsumesRequestCondition.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ConsumesRequestCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -28,8 +28,6 @@ import javax.servlet.http.HttpServletRequest; import org.springframework.http.InvalidMediaTypeException; import org.springframework.http.MediaType; import org.springframework.util.StringUtils; -import org.springframework.web.HttpMediaTypeException; -import org.springframework.web.HttpMediaTypeNotSupportedException; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.cors.CorsUtils; import org.springframework.web.servlet.mvc.condition.HeadersRequestCondition.HeaderExpression; @@ -50,7 +48,6 @@ public final class ConsumesRequestCondition extends AbstractRequestCondition expressions; @@ -129,6 +126,7 @@ public final class ConsumesRequestCondition extends AbstractRequestCondition { - private final static ProducesRequestCondition PRE_FLIGHT_MATCH = new ProducesRequestCondition(); + private static final ProducesRequestCondition PRE_FLIGHT_MATCH = new ProducesRequestCondition(); private static final ProducesRequestCondition EMPTY_CONDITION = new ProducesRequestCondition(); - - private final List MEDIA_TYPE_ALL_LIST = + private static final List MEDIA_TYPE_ALL_LIST = Collections.singletonList(new ProduceMediaTypeExpression("*/*")); + private final List expressions; private final ContentNegotiationManager contentNegotiationManager; @@ -66,7 +66,7 @@ public final class ProducesRequestCondition extends AbstractRequestCondition message) throws IOException { if (shouldNotSend()) { return; @@ -124,10 +125,9 @@ public class ConcurrentWebSocketSessionDecorator extends WebSocketSessionDecorat do { if (!tryFlushMessageBuffer()) { if (logger.isTraceEnabled()) { - String text = String.format("Another send already in progress: " + + logger.trace(String.format("Another send already in progress: " + "session id '%s':, \"in-progress\" send time %d (ms), buffer size %d bytes", - getId(), getTimeSinceSendStarted(), getBufferSize()); - logger.trace(text); + getId(), getTimeSinceSendStarted(), getBufferSize())); } checkSessionLimits(); break; diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/AbstractTyrusRequestUpgradeStrategy.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/AbstractTyrusRequestUpgradeStrategy.java index 9d62b4c573d..411e78c3f39 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/AbstractTyrusRequestUpgradeStrategy.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/AbstractTyrusRequestUpgradeStrategy.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. @@ -79,6 +79,7 @@ public abstract class AbstractTyrusRequestUpgradeStrategy extends AbstractStanda return StringUtils.tokenizeToStringArray(Version.getSupportedWireProtocolVersions(), ","); } + @Override protected List getInstalledExtensions(WebSocketContainer container) { try { return super.getInstalledExtensions(container); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/TomcatRequestUpgradeStrategy.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/TomcatRequestUpgradeStrategy.java index 0948aec5b73..f3a6aaf50df 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/TomcatRequestUpgradeStrategy.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/TomcatRequestUpgradeStrategy.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. @@ -80,6 +80,7 @@ public class TomcatRequestUpgradeStrategy extends AbstractStandardUpgradeStrateg } } + @Override public WsServerContainer getContainer(HttpServletRequest request) { return (WsServerContainer) super.getContainer(request); } diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/UndertowRequestUpgradeStrategy.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/UndertowRequestUpgradeStrategy.java index 327df2f2c1f..cc9a64fa3d3 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/UndertowRequestUpgradeStrategy.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/UndertowRequestUpgradeStrategy.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. @@ -123,6 +123,7 @@ public class UndertowRequestUpgradeStrategy extends AbstractStandardUpgradeStrat } } + @Override public ServerWebSocketContainer getContainer(HttpServletRequest request) { return (ServerWebSocketContainer) super.getContainer(request); }