Merge pull request #154 from philwebb/SPR-9285

* SPR-9285:
  Chain exception cause on create failure
This commit is contained in:
Phillip Webb 2012-10-10 14:05:56 -07:00
commit e5cfe8a2c5
1 changed files with 4 additions and 2 deletions

View File

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