Browse Source

Chain exception cause on create failure

Propogate root cause of exceptions thrown from createCollection
and createMap.

Issue: SPR-9285
Backport-Commit: 2e48656906
pull/1536/head
Phillip Webb 12 years ago committed by Chris Beams
parent
commit
98075c33c6
  1. 6
      org.springframework.core/src/main/java/org/springframework/core/CollectionFactory.java

6
org.springframework.core/src/main/java/org/springframework/core/CollectionFactory.java

@ -255,7 +255,8 @@ public abstract class CollectionFactory { @@ -255,7 +255,8 @@ public abstract class CollectionFactory {
return (Collection) collectionType.newInstance();
}
catch (Exception ex) {
throw new IllegalArgumentException("Could not instantiate Collection type: " + collectionType.getName());
throw new IllegalArgumentException("Could not instantiate Collection type: " +
collectionType.getName(), ex);
}
}
}
@ -322,7 +323,8 @@ public abstract class CollectionFactory { @@ -322,7 +323,8 @@ public abstract class CollectionFactory {
return (Map) mapType.newInstance();
}
catch (Exception ex) {
throw new IllegalArgumentException("Could not instantiate Map type: " + mapType.getName());
throw new IllegalArgumentException("Could not instantiate Map type: " +
mapType.getName(), ex);
}
}
}

Loading…
Cancel
Save