Navigation Menu

Skip to content

Commit

Permalink
SimpleTypeHolder considers Object to be a simple type.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Aug 19, 2011
1 parent 2f5c4cd commit a330301
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Expand Up @@ -116,6 +116,9 @@ public SimpleTypeHolder(Set<? extends Class<?>> customSimpleTypes, SimpleTypeHol
*/
public boolean isSimpleType(Class<?> type) {
Assert.notNull(type);
if (Object.class.equals(type)) {
return true;
}
for (Class<?> clazz : simpleTypes) {
if (type == clazz || clazz.isAssignableFrom(type)) {
return true;
Expand Down
Expand Up @@ -86,4 +86,10 @@ public void createsHolderFromAnotherOneCorrectly() {
assertThat(second.isSimpleType(SimpleTypeHolder.class), is(true));
assertThat(second.isSimpleType(SimpleTypeHolderUnitTests.class), is(true));
}

@Test
public void considersObjectToBeSimpleType() {
SimpleTypeHolder holder = new SimpleTypeHolder();
assertThat(holder.isSimpleType(Object.class), is(true));
}
}

0 comments on commit a330301

Please sign in to comment.