DATACMNS-31 - Added null check to SimpleTypeHolder.isSimpleType(…).
The MappingBeanHelper mentioned in the ticket was recently replaced by SimpleTypeHolder.
This commit is contained in:
@@ -115,6 +115,7 @@ public class SimpleTypeHolder {
|
||||
* @return
|
||||
*/
|
||||
public boolean isSimpleType(Class<?> type) {
|
||||
Assert.notNull(type);
|
||||
for (Class<?> clazz : simpleTypes) {
|
||||
if (type == clazz || clazz.isAssignableFrom(type)) {
|
||||
return true;
|
||||
|
||||
@@ -39,6 +39,15 @@ public class SimpleTypeHolderUnitTests {
|
||||
public void rejectsNullOriginal() {
|
||||
new SimpleTypeHolder(new HashSet<Class<?>>(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-31
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void rejectsNullTypeForIsSimpleTypeCall() {
|
||||
SimpleTypeHolder holder = new SimpleTypeHolder();
|
||||
holder.isSimpleType(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void addsDefaultTypes() {
|
||||
|
||||
Reference in New Issue
Block a user