diff --git a/gradle/publish-maven.gradle b/gradle/publish-maven.gradle
index 1145e112a66..eff54387f69 100644
--- a/gradle/publish-maven.gradle
+++ b/gradle/publish-maven.gradle
@@ -29,8 +29,8 @@ def customizePom(pom, gradleProject) {
}
licenses {
license {
- name "The Apache Software License, Version 2.0"
- url "http://www.apache.org/licenses/LICENSE-2.0.txt"
+ name "Apache License, Version 2.0"
+ url "http://www.apache.org/licenses/LICENSE-2.0"
distribution "repo"
}
}
diff --git a/spring-context/src/main/java/org/springframework/cache/config/CacheNamespaceHandler.java b/spring-context/src/main/java/org/springframework/cache/config/CacheNamespaceHandler.java
index 59dcc256dfb..68bcbcbdca1 100644
--- a/spring-context/src/main/java/org/springframework/cache/config/CacheNamespaceHandler.java
+++ b/spring-context/src/main/java/org/springframework/cache/config/CacheNamespaceHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 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.
@@ -39,10 +39,11 @@ public class CacheNamespaceHandler extends NamespaceHandlerSupport {
static final String DEFAULT_CACHE_MANAGER_BEAN_NAME = "cacheManager";
+
static String extractCacheManager(Element element) {
- return (element.hasAttribute(CacheNamespaceHandler.CACHE_MANAGER_ATTRIBUTE) ? element
- .getAttribute(CacheNamespaceHandler.CACHE_MANAGER_ATTRIBUTE)
- : CacheNamespaceHandler.DEFAULT_CACHE_MANAGER_BEAN_NAME);
+ return (element.hasAttribute(CacheNamespaceHandler.CACHE_MANAGER_ATTRIBUTE) ?
+ element.getAttribute(CacheNamespaceHandler.CACHE_MANAGER_ATTRIBUTE) :
+ CacheNamespaceHandler.DEFAULT_CACHE_MANAGER_BEAN_NAME);
}
static BeanDefinition parseKeyGenerator(Element element, BeanDefinition def) {
@@ -53,9 +54,11 @@ public class CacheNamespaceHandler extends NamespaceHandlerSupport {
return def;
}
+
@Override
public void init() {
registerBeanDefinitionParser("annotation-driven", new AnnotationDrivenCacheBeanDefinitionParser());
registerBeanDefinitionParser("advice", new CacheAdviceParser());
}
+
}
diff --git a/spring-context/src/main/java/org/springframework/context/annotation/Configuration.java b/spring-context/src/main/java/org/springframework/context/annotation/Configuration.java
index 5e96e5fa1ab..04627fb749b 100644
--- a/spring-context/src/main/java/org/springframework/context/annotation/Configuration.java
+++ b/spring-context/src/main/java/org/springframework/context/annotation/Configuration.java
@@ -390,7 +390,7 @@ public @interface Configuration {
/**
* Explicitly specify the name of the Spring bean definition associated
- * with this Configuration class. If left unspecified (the common case),
+ * with this Configuration class. If left unspecified (the common case),
* a bean name will be automatically generated.
*
The custom name applies only if the Configuration class is picked up via
* component scanning or supplied directly to a {@link AnnotationConfigApplicationContext}.
diff --git a/spring-context/src/main/java/org/springframework/context/event/AbstractApplicationEventMulticaster.java b/spring-context/src/main/java/org/springframework/context/event/AbstractApplicationEventMulticaster.java
index b7dd9186a18..fa93701c383 100644
--- a/spring-context/src/main/java/org/springframework/context/event/AbstractApplicationEventMulticaster.java
+++ b/spring-context/src/main/java/org/springframework/context/event/AbstractApplicationEventMulticaster.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.
@@ -256,8 +256,8 @@ public abstract class AbstractApplicationEventMulticaster
* for the given event type
*/
protected boolean supportsEvent(Class> listenerType, ResolvableType eventType) {
- if (GenericApplicationListener.class.isAssignableFrom(listenerType)
- || SmartApplicationListener.class.isAssignableFrom(listenerType)) {
+ if (GenericApplicationListener.class.isAssignableFrom(listenerType) ||
+ SmartApplicationListener.class.isAssignableFrom(listenerType)) {
return true;
}
ResolvableType declaredEventType = GenericApplicationListenerAdapter.resolveDeclaredEventType(listenerType);
diff --git a/spring-context/src/main/java/org/springframework/context/event/ApplicationEventMulticaster.java b/spring-context/src/main/java/org/springframework/context/event/ApplicationEventMulticaster.java
index 98053230400..e00601d2437 100644
--- a/spring-context/src/main/java/org/springframework/context/event/ApplicationEventMulticaster.java
+++ b/spring-context/src/main/java/org/springframework/context/event/ApplicationEventMulticaster.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.
@@ -79,6 +79,7 @@ public interface ApplicationEventMulticaster {
* based on the {@code event} instance.
* @param event the event to multicast
* @param eventType the type of event (can be null)
+ * @since 4.2
*/
void multicastEvent(ApplicationEvent event, ResolvableType eventType);
diff --git a/spring-context/src/main/java/org/springframework/context/event/EventListenerMethodProcessor.java b/spring-context/src/main/java/org/springframework/context/event/EventListenerMethodProcessor.java
index 7a95f172e3d..278021f50c5 100644
--- a/spring-context/src/main/java/org/springframework/context/event/EventListenerMethodProcessor.java
+++ b/spring-context/src/main/java/org/springframework/context/event/EventListenerMethodProcessor.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.
@@ -145,7 +145,7 @@ public class EventListenerMethodProcessor implements SmartInitializingSingleton,
if (CollectionUtils.isEmpty(annotatedMethods)) {
this.nonAnnotatedClasses.add(targetType);
if (logger.isTraceEnabled()) {
- logger.trace("No @EventListener annotations found on bean class: " + targetType);
+ logger.trace("No @EventListener annotations found on bean class: " + targetType.getName());
}
}
else {
diff --git a/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java b/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java
index e52d5d4f8bb..393c3ce2dcf 100644
--- a/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java
+++ b/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.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.
@@ -23,10 +23,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Declares that a field should be formatted as a date time.
+ * Declares that a field or method parameter should be formatted as a date or time.
*
*
Supports formatting by style pattern, ISO date time pattern, or custom format pattern string.
- * Can be applied to {@code java.util.Date}, {@code java.util.Calendar}, {@code java.long.Long},
+ * Can be applied to {@code java.util.Date}, {@code java.util.Calendar}, {@code java.lang.Long},
* Joda-Time value types; and as of Spring 4 and JDK 8, to JSR-310 java.time types too.
*
*
For style-based formatting, set the {@link #style} attribute to be the style pattern code.
@@ -35,7 +35,7 @@ import java.lang.annotation.Target;
* A date or time may be omitted by specifying the style character '-'.
*
*
For ISO-based formatting, set the {@link #iso} attribute to be the desired {@link ISO} format,
- * such as {@link ISO#DATE}. For custom formatting, set the {@link #pattern()} attribute to be the
+ * such as {@link ISO#DATE}. For custom formatting, set the {@link #pattern} attribute to be the
* DateTime pattern, such as {@code yyyy/MM/dd hh:mm:ss a}.
*
*
Each attribute is mutually exclusive, so only set one attribute per annotation instance
@@ -64,7 +64,7 @@ public @interface DateTimeFormat {
/**
* The ISO pattern to use to format the field.
- * The possible ISO patterns are defined in the {@link ISO} enum.
+ *
The possible ISO patterns are defined in the {@link ISO} enum.
*
Defaults to {@link ISO#NONE}, indicating this attribute should be ignored.
* Set this attribute when you wish to format your field in accordance with an ISO format.
*/
diff --git a/spring-context/src/main/java/org/springframework/format/annotation/NumberFormat.java b/spring-context/src/main/java/org/springframework/format/annotation/NumberFormat.java
index d56c46cae95..3424143ec59 100644
--- a/spring-context/src/main/java/org/springframework/format/annotation/NumberFormat.java
+++ b/spring-context/src/main/java/org/springframework/format/annotation/NumberFormat.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.
@@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Declares that a field should be formatted as a number.
+ * Declares that a field or method parameter should be formatted as a number.
*
*
Supports formatting by style or custom pattern string.
* Can be applied to any JDK {@code java.lang.Number} type.
@@ -37,7 +37,7 @@ import java.lang.annotation.Target;
* When the {@link #pattern} attribute is specified, it takes precedence over
* the {@link #style} attribute. When no annotation attributes are specified,
* the default format applied is style-based for either number of currency,
- * depending on the annotated field type.
+ * depending on the annotated field or method parameter type.
*
* @author Keith Donald
* @author Juergen Hoeller
diff --git a/spring-core/src/main/java/org/springframework/asm/package-info.java b/spring-core/src/main/java/org/springframework/asm/package-info.java
index 98c9a0d8ca8..dc7bf516933 100644
--- a/spring-core/src/main/java/org/springframework/asm/package-info.java
+++ b/spring-core/src/main/java/org/springframework/asm/package-info.java
@@ -1,6 +1,6 @@
/**
* Spring's repackaging of
- * org.objectweb.asm 5.0
+ * ASM
* (for internal use only).
*
*
This repackaging technique avoids any potential conflicts with
@@ -8,8 +8,6 @@
* libraries and frameworks.
*
*
As this repackaging happens at the class file level, sources
- * and javadocs are not available here. See the original ObjectWeb
- * ASM 5.0 javadocs
- * for details when working with these classes.
+ * and javadocs are not available here.
*/
package org.springframework.asm;
diff --git a/spring-core/src/main/java/org/springframework/cglib/package-info.java b/spring-core/src/main/java/org/springframework/cglib/package-info.java
index 78ef762beed..85d1758e539 100644
--- a/spring-core/src/main/java/org/springframework/cglib/package-info.java
+++ b/spring-core/src/main/java/org/springframework/cglib/package-info.java
@@ -1,6 +1,6 @@
/**
* Spring's repackaging of
- * net.sf.cglib 3.2
+ * CGLIB
* (for internal use only).
*
*
This repackaging technique avoids any potential conflicts with
@@ -8,8 +8,6 @@
* libraries and frameworks.
*
*
As this repackaging happens at the class file level, sources
- * and javadocs are not available here. See the original
- * CGLIB 3.2 javadocs
- * for details when working with these classes.
+ * and javadocs are not available here.
*/
package org.springframework.cglib;
diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/CollectionToObjectConverter.java b/spring-core/src/main/java/org/springframework/core/convert/support/CollectionToObjectConverter.java
index bcc51e2f951..052105e6ef1 100644
--- a/spring-core/src/main/java/org/springframework/core/convert/support/CollectionToObjectConverter.java
+++ b/spring-core/src/main/java/org/springframework/core/convert/support/CollectionToObjectConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 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.
@@ -57,7 +57,7 @@ final class CollectionToObjectConverter implements ConditionalGenericConverter {
return source;
}
Collection> sourceCollection = (Collection>) source;
- if (sourceCollection.size() == 0) {
+ if (sourceCollection.isEmpty()) {
return null;
}
Object firstElement = sourceCollection.iterator().next();
diff --git a/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java b/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java
index b53cefa1d81..1b3489a40bd 100644
--- a/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java
+++ b/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.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.
@@ -154,7 +154,7 @@ public class PathMatchingResourcePatternResolverTests {
private void assertFilenameIn(Resource resource, String... filenames) {
String filename = resource.getFilename();
assertTrue(resource + " does not have a filename that matches any of the specified names",
- Arrays.stream(filenames).anyMatch(filename::endsWith));
+ Arrays.stream(filenames).anyMatch(filename::endsWith));
}
}
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ScriptUtils.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ScriptUtils.java
index 77d302eefff..10076a01c60 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ScriptUtils.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ScriptUtils.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.
@@ -168,11 +168,11 @@ public abstract class ScriptUtils {
String blockCommentStartDelimiter, String blockCommentEndDelimiter, List statements)
throws ScriptException {
- Assert.hasText(script, "script must not be null or empty");
- Assert.notNull(separator, "separator must not be null");
- Assert.hasText(commentPrefix, "commentPrefix must not be null or empty");
- Assert.hasText(blockCommentStartDelimiter, "blockCommentStartDelimiter must not be null or empty");
- Assert.hasText(blockCommentEndDelimiter, "blockCommentEndDelimiter must not be null or empty");
+ Assert.hasText(script, "'script' must not be null or empty");
+ Assert.notNull(separator, "'separator' must not be null");
+ Assert.hasText(commentPrefix, "'commentPrefix' must not be null or empty");
+ Assert.hasText(blockCommentStartDelimiter, "'blockCommentStartDelimiter' must not be null or empty");
+ Assert.hasText(blockCommentEndDelimiter, "'blockCommentEndDelimiter' must not be null or empty");
StringBuilder sb = new StringBuilder();
boolean inSingleQuote = false;
@@ -199,7 +199,7 @@ public abstract class ScriptUtils {
}
if (!inSingleQuote && !inDoubleQuote) {
if (script.startsWith(separator, i)) {
- // we've reached the end of the current statement
+ // We've reached the end of the current statement
if (sb.length() > 0) {
statements.add(sb.toString());
sb = new StringBuilder();
@@ -208,32 +208,31 @@ public abstract class ScriptUtils {
continue;
}
else if (script.startsWith(commentPrefix, i)) {
- // skip over any content from the start of the comment to the EOL
+ // Skip over any content from the start of the comment to the EOL
int indexOfNextNewline = script.indexOf("\n", i);
if (indexOfNextNewline > i) {
i = indexOfNextNewline;
continue;
}
else {
- // if there's no EOL, we must be at the end
- // of the script, so stop here.
+ // If there's no EOL, we must be at the end of the script, so stop here.
break;
}
}
else if (script.startsWith(blockCommentStartDelimiter, i)) {
- // skip over any block comments
+ // Skip over any block comments
int indexOfCommentEnd = script.indexOf(blockCommentEndDelimiter, i);
if (indexOfCommentEnd > i) {
i = indexOfCommentEnd + blockCommentEndDelimiter.length() - 1;
continue;
}
else {
- throw new ScriptParseException(String.format("Missing block comment end delimiter [%s].",
- blockCommentEndDelimiter), resource);
+ throw new ScriptParseException(
+ "Missing block comment end delimiter: " + blockCommentEndDelimiter, resource);
}
}
else if (c == ' ' || c == '\n' || c == '\t') {
- // avoid multiple adjacent whitespace characters
+ // Avoid multiple adjacent whitespace characters
if (sb.length() > 0 && sb.charAt(sb.length() - 1) != ' ') {
c = ' ';
}
diff --git a/spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java
index 643a8713f0e..e7776f0751b 100644
--- a/spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java
+++ b/spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.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.
@@ -395,12 +395,7 @@ public class FormHttpMessageConverter implements HttpMessageConverter getHttpEntity(Object part) {
- if (part instanceof HttpEntity) {
- return (HttpEntity>) part;
- }
- else {
- return new HttpEntity