Skip to content

Commit 7785fb7

Browse files
authored
Possible fix for json-iterator#168 - Always create new instance of col
1 parent bc4a712 commit 7785fb7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/main/java/com/jsoniter/ReflectionCollectionDecoder.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ private Object decode_(JsonIterator iter) throws Exception {
3838
if (iter.readNull()) {
3939
return null;
4040
}
41-
if (col == null) {
42-
col = (Collection) this.ctor.newInstance();
43-
} else {
44-
col.clear();
45-
}
41+
col = (Collection) this.ctor.newInstance();
4642
while (iter.readArray()) {
4743
col.add(compTypeDecoder.decode(iter));
4844
}

0 commit comments

Comments
 (0)