diff --git a/spring-aop/src/main/java/org/aopalliance/aop/package-info.java b/spring-aop/src/main/java/org/aopalliance/aop/package-info.java new file mode 100644 index 0000000000..add1d414f6 --- /dev/null +++ b/spring-aop/src/main/java/org/aopalliance/aop/package-info.java @@ -0,0 +1,4 @@ +/** + * The core AOP Alliance advice marker. + */ +package org.aopalliance.aop; diff --git a/spring-aop/src/main/java/org/aopalliance/intercept/package-info.java b/spring-aop/src/main/java/org/aopalliance/intercept/package-info.java new file mode 100644 index 0000000000..11ada4f946 --- /dev/null +++ b/spring-aop/src/main/java/org/aopalliance/intercept/package-info.java @@ -0,0 +1,4 @@ +/** + * The AOP Alliance reflective interception abstraction. + */ +package org.aopalliance.intercept; diff --git a/spring-aop/src/main/java/org/aopalliance/package-info.java b/spring-aop/src/main/java/org/aopalliance/package-info.java new file mode 100644 index 0000000000..a525a32aec --- /dev/null +++ b/spring-aop/src/main/java/org/aopalliance/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring's variant of the AOP Alliance interfaces. + */ +package org.aopalliance; 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 59dcc256df..68bcbcbdca 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 5e96e5fa1a..04627fb749 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/validation/beanvalidation/LocalValidatorFactoryBean.java b/spring-context/src/main/java/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.java index 607ed56ca9..f9c2efc169 100644 --- a/spring-context/src/main/java/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.java @@ -355,6 +355,7 @@ public class LocalValidatorFactoryBean extends SpringValidatorAdapter @Override public ParameterNameProvider getParameterNameProvider() { + Assert.notNull(this.validatorFactory, "No target ValidatorFactory set"); return this.validatorFactory.getParameterNameProvider(); } 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 98c9a0d8ca..dc7bf51693 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 78ef762bee..85d1758e53 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/test/java/org/springframework/util/ObjectUtilsTests.java b/spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java
index 71570eea61..57af7b38b7 100644
--- a/spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java
+++ b/spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.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.
@@ -239,18 +239,21 @@ public class ObjectUtilsTests {
}
@Test
+ @Deprecated
public void hashCodeWithBooleanFalse() {
int expected = Boolean.FALSE.hashCode();
assertEquals(expected, ObjectUtils.hashCode(false));
}
@Test
+ @Deprecated
public void hashCodeWithBooleanTrue() {
int expected = Boolean.TRUE.hashCode();
assertEquals(expected, ObjectUtils.hashCode(true));
}
@Test
+ @Deprecated
public void hashCodeWithDouble() {
double dbl = 9830.43;
int expected = (new Double(dbl)).hashCode();
@@ -258,6 +261,7 @@ public class ObjectUtilsTests {
}
@Test
+ @Deprecated
public void hashCodeWithFloat() {
float flt = 34.8f;
int expected = (new Float(flt)).hashCode();
@@ -265,6 +269,7 @@ public class ObjectUtilsTests {
}
@Test
+ @Deprecated
public void hashCodeWithLong() {
long lng = 883l;
int expected = (new Long(lng)).hashCode();
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 5ff0cebf64..18190283c3 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
@@ -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 19194622fd..19c5b308a7 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.
@@ -396,12 +396,7 @@ public class FormHttpMessageConverter implements HttpMessageConverter NOTE: Use of this option requires the presence of the
- * Apache Commons Codec library on the classpath when running on Java 6 or 7.
- * On Java 8, the standard {@link java.util.Base64} facility is used instead.
* @see GsonBuilderUtils#gsonBuilderWithBase64EncodedByteArrays()
*/
public void setBase64EncodeByteArrays(boolean base64EncodeByteArrays) {
diff --git a/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java
index 884a53b34d..b9b3afc775 100644
--- a/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java
+++ b/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.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.
@@ -230,6 +230,7 @@ public class Jaxb2CollectionHttpMessageConverter