diff --git a/build.gradle b/build.gradle
index b94a6080401..ceb4cfd933f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -441,7 +441,7 @@ project("spring-tx") {
compile(project(":spring-beans"))
compile(project(":spring-core"))
optional(project(":spring-aop"))
- optional(project(":spring-context")) // for JCA, @EnableTransactionManagement
+ optional(project(":spring-context")) // for JCA, @EnableTransactionManagement
optional("aopalliance:aopalliance:1.0")
optional("javax.transaction:javax.transaction-api:1.2")
optional("javax.resource:connector-api:1.5")
@@ -516,7 +516,7 @@ project("spring-jdbc") {
compile(project(":spring-beans"))
compile(project(":spring-core"))
compile(project(":spring-tx"))
- optional(project(":spring-context")) // for JndiDataSourceLookup
+ optional(project(":spring-context")) // for JndiDataSourceLookup
optional("javax.transaction:javax.transaction-api:1.2")
optional("com.mchange:c3p0:0.9.2.1")
optional("org.hsqldb:hsqldb:${hsqldbVersion}")
@@ -533,8 +533,8 @@ project("spring-context-support") {
compile(project(":spring-core"))
compile(project(":spring-beans"))
compile(project(":spring-context"))
- optional(project(":spring-jdbc")) // for Quartz support
- optional(project(":spring-tx")) // for Quartz support
+ optional(project(":spring-jdbc")) // for Quartz support
+ optional(project(":spring-tx")) // for Quartz support
optional("javax.mail:javax.mail-api:1.4.7")
optional("javax.cache:cache-api:1.0.0")
optional("com.google.guava:guava:17.0")
@@ -550,8 +550,8 @@ project("spring-context-support") {
exclude group: "xml-apis", module: "xml-apis"
}
testCompile("org.apache.poi:poi:3.10.1")
- testCompile("commons-beanutils:commons-beanutils:1.8.0") // for Velocity/JasperReports
- testCompile("commons-digester:commons-digester:1.8.1") // for Velocity/JasperReports
+ testCompile("commons-beanutils:commons-beanutils:1.8.0") // for Velocity/JasperReports
+ testCompile("commons-digester:commons-digester:1.8.1") // for Velocity/JasperReports
testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
testRuntime("com.sun.mail:javax.mail:1.4.7")
@@ -565,12 +565,12 @@ project("spring-web") {
description = "Spring Web"
dependencies {
- compile(project(":spring-aop")) // for JaxWsPortProxyFactoryBean
- compile(project(":spring-beans")) // for MultiPartFilter
+ compile(project(":spring-aop")) // for JaxWsPortProxyFactoryBean
+ compile(project(":spring-beans")) // for MultipartFilter
compile(project(":spring-context"))
compile(project(":spring-core"))
provided("javax.servlet:javax.servlet-api:3.0.1")
- optional(project(":spring-oxm")) // for MarshallingHttpMessageConverter
+ optional(project(":spring-oxm")) // for MarshallingHttpMessageConverter
optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
optional("javax.portlet:portlet-api:2.0")
optional("javax.el:javax.el-api:2.2.5")
@@ -578,7 +578,7 @@ project("spring-web") {
optional("aopalliance:aopalliance:1.0")
optional("com.caucho:hessian:4.0.7")
optional("commons-fileupload:commons-fileupload:1.3.1")
- optional("org.apache.httpcomponents:httpclient:4.3.5")
+ optional("org.apache.httpcomponents:httpclient:4.3.6")
optional("org.apache.httpcomponents:httpasyncclient:4.0.2")
optional("org.codehaus.jackson:jackson-mapper-asl:${jackson1Version}")
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
@@ -711,8 +711,8 @@ project("spring-webmvc") {
compile(project(":spring-expression"))
compile(project(":spring-web"))
provided("javax.servlet:javax.servlet-api:3.0.1")
- optional(project(":spring-context-support")) // for Velocity support
- optional(project(":spring-oxm")) // for MarshallingView
+ optional(project(":spring-context-support")) // for Velocity support
+ optional(project(":spring-oxm")) // for MarshallingView
optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
optional("net.sourceforge.jexcelapi:jxl:2.6.12")
@@ -764,7 +764,7 @@ project("spring-webmvc") {
}
testCompile("javax.validation:validation-api:1.0.0.GA")
testCompile("org.hibernate:hibernate-validator:${hibVal4Version}")
- testCompile("org.apache.httpcomponents:httpclient:4.3.5")
+ testCompile("org.apache.httpcomponents:httpclient:4.3.6")
testCompile("commons-fileupload:commons-fileupload:1.3.1")
testCompile("commons-io:commons-io:1.3")
testCompile("joda-time:joda-time:${jodaVersion}")
@@ -915,13 +915,13 @@ project("spring-aspects") {
rt("org.aspectj:aspectjrt:${aspectjVersion}")
compile("org.aspectj:aspectjweaver:${aspectjVersion}")
provided("org.eclipse.persistence:javax.persistence:2.0.0")
- optional(project(":spring-aop")) // for @Async support
- optional(project(":spring-beans")) // for @Configurable support
- optional(project(":spring-context")) // for @Enable* support
- optional(project(":spring-context-support")) // for JavaMail support
- optional(project(":spring-orm")) // for JPA exception translation support
- optional(project(":spring-tx")) // for JPA, @Transactional support
- testCompile(project(":spring-core")) // for CodeStyleAspect
+ optional(project(":spring-aop")) // for @Async support
+ optional(project(":spring-beans")) // for @Configurable support
+ optional(project(":spring-context")) // for @Enable* support
+ optional(project(":spring-context-support")) // for JavaMail support
+ optional(project(":spring-orm")) // for JPA exception translation support
+ optional(project(":spring-tx")) // for JPA, @Transactional support
+ testCompile(project(":spring-core")) // for CodeStyleAspect
testCompile(project(":spring-test"))
testCompile("javax.mail:javax.mail-api:1.4.7")
}
@@ -1157,7 +1157,7 @@ configure(rootProject) {
}
}
- // Create an distribution that contains all dependencies (required and optional).
+ // Create a distribution that contains all dependencies (required and optional).
// Not published by default; only for use when building from source.
task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
group = "Distribution"
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
index 484445cd905..4847dfdddf5 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2013 the original author or authors.
+ * Copyright 2002-2014 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.
@@ -104,9 +104,11 @@ public class DefaultListableBeanFactoryTests {
private static final Log factoryLog = LogFactory.getLog(DefaultListableBeanFactory.class);
+
@Rule
public ExpectedException thrown = ExpectedException.none();
+
@Test
public void testUnreferencedSingletonWasInstantiated() {
KnowsIfInstantiated.clearInstantiationRecord();
@@ -2748,6 +2750,7 @@ public class DefaultListableBeanFactoryTests {
}
}
+
@SuppressWarnings("unused")
private static class KnowsIfInstantiated {
diff --git a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/testUtilNamespace.xml b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/testUtilNamespace.xml
index 2262cd038e7..2b71bca48f5 100644
--- a/spring-beans/src/test/resources/org/springframework/beans/factory/xml/testUtilNamespace.xml
+++ b/spring-beans/src/test/resources/org/springframework/beans/factory/xml/testUtilNamespace.xml
@@ -15,7 +15,7 @@
+ "/>
diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToArrayConverter.java b/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToArrayConverter.java
index bdad578fc5d..df3b730d11b 100644
--- a/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToArrayConverter.java
+++ b/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToArrayConverter.java
@@ -27,8 +27,9 @@ import org.springframework.core.convert.converter.ConditionalGenericConverter;
import org.springframework.util.ObjectUtils;
/**
- * Converts an Array to another Array. First adapts the source array to a List, then
- * delegates to {@link CollectionToArrayConverter} to perform the target array conversion.
+ * Converts an array to another array. First adapts the source array to a List,
+ * then delegates to {@link CollectionToArrayConverter} to perform the target
+ * array conversion.
*
* @author Keith Donald
* @author Phillip Webb
diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToCollectionConverter.java b/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToCollectionConverter.java
index 30f3de5593d..50c5787059c 100644
--- a/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToCollectionConverter.java
+++ b/spring-core/src/main/java/org/springframework/core/convert/support/ArrayToCollectionConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2014 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.
@@ -27,23 +27,27 @@ import org.springframework.core.convert.TypeDescriptor;
import org.springframework.core.convert.converter.ConditionalGenericConverter;
/**
- * Converts an Array to a Collection.
+ * Converts an array to a Collection.
*
- *
First, creates a new Collection of the requested targetType.
+ *
First, creates a new Collection of the requested target type.
* Then adds each array element to the target collection.
- * Will perform an element conversion from the source component type to the collection's parameterized type if necessary.
+ * Will perform an element conversion from the source component type
+ * to the collection's parameterized type if necessary.
*
* @author Keith Donald
+ * @author Juergen Hoeller
* @since 3.0
*/
final class ArrayToCollectionConverter implements ConditionalGenericConverter {
private final ConversionService conversionService;
+
public ArrayToCollectionConverter(ConversionService conversionService) {
this.conversionService = conversionService;
}
+
@Override
public Set getConvertibleTypes() {
return Collections.singleton(new ConvertiblePair(Object[].class, Collection.class));
@@ -60,9 +64,12 @@ final class ArrayToCollectionConverter implements ConditionalGenericConverter {
if (source == null) {
return null;
}
+
int length = Array.getLength(source);
+ TypeDescriptor elementDesc = targetType.getElementTypeDescriptor();
Collection