Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
RuedigerMoeller committed Aug 22, 2015
1 parent 6254040 commit b8a8abb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/nustaq/kson/KsonDeserializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ public Object readObject(Class expect, Class genericKeyType, Class genericValueT
stack.pop();
}
} else {
res = clInfo.newInstance(true);
try {
res = clInfo.getClazz().newInstance(); // first try empty constructor to keep default values
} catch (Throwable th) {}
if ( res == null )
res = clInfo.newInstance(true);
if (res==null) {
throw new RuntimeException(clInfo.getClazz().getName()+" misses a default constructor. Instantiation failed.");
}
Expand Down

0 comments on commit b8a8abb

Please sign in to comment.