diff --git a/build.gradle b/build.gradle
index 01c240b5da..ee0c340306 100644
--- a/build.gradle
+++ b/build.gradle
@@ -359,7 +359,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("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1")
optional("javax.resource:connector-api:1.5")
@@ -434,7 +434,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("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1")
optional("c3p0:c3p0:0.9.1.2")
optional("hsqldb:hsqldb:${hsqldbVersion}")
@@ -452,8 +452,8 @@ project("spring-context-support") {
compile(project(":spring-beans"))
compile(project(":spring-context"))
provided("javax.activation:activation:1.1")
- 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:mail:1.4.7")
optional("javax.cache:cache-api:0.5")
optional("net.sf.ehcache:ehcache-core:2.0.1")
@@ -464,8 +464,8 @@ project("spring-context-support") {
optional("com.lowagie:itext:2.1.7")
optional("net.sf.jasperreports:jasperreports:3.7.6")
testCompile("org.apache.poi:poi:3.6")
- 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("hsqldb:hsqldb:${hsqldbVersion}")
testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
}
@@ -478,13 +478,13 @@ 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")
provided("javax.activation:activation:1.1")
- optional(project(":spring-oxm")) // for MarshallingHttpMessageConverter
+ optional(project(":spring-oxm")) // for MarshallingHttpMessageConverter
optional("javax.servlet.jsp:jsp-api:2.1")
optional("javax.portlet:portlet-api:2.0")
optional("javax.el:el-api:1.0")
@@ -578,8 +578,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:jsp-api:2.1")
optional("javax.servlet:jstl:1.2")
optional("net.sourceforge.jexcelapi:jxl:2.6.12")
@@ -786,13 +786,13 @@ project("spring-aspects") {
rt("org.aspectj:aspectjrt:${aspectjVersion}")
compile("org.aspectj:aspectjweaver:${aspectjVersion}")
provided("javax.persistence:persistence-api:1.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:mail:1.4.7")
}
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 8ea5f7890c..1dbc07c1c2 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();
@@ -2676,6 +2678,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 2262cd038e..2b71bca48f 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 b2098494e8..bb5c7331fc 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 4e028b49a9..d034eddbca 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-2011 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;
}
+
public Set getConvertibleTypes() {
return Collections.singleton(new ConvertiblePair(Object[].class, Collection.class));
}
@@ -58,9 +62,12 @@ final class ArrayToCollectionConverter implements ConditionalGenericConverter {
if (source == null) {
return null;
}
+
int length = Array.getLength(source);
+ TypeDescriptor elementDesc = targetType.getElementTypeDescriptor();
Collection