Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0913eff

Browse files
authored
Merge pull request #169 from elifarley/patch-1
Possible fix for #168 - Always create new instance of col
2 parents bc4a712 + 7785fb7 commit 0913eff

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)

AltStyle によって変換されたページ (->オリジナル) /