Skip to content

Commit d8a370e

Browse files
committed
bug fix for graal support
1 parent 798cf95 commit d8a370e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/src/main/java/com/alibaba/fastjson2/reader/FieldReaderListField.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ public void readFieldValue(JSONReader jsonReader, T object) {
129129
return;
130130
}
131131

132-
if (jsonReader.current() == '[') {
132+
boolean set = false;
133+
if (jsonReader.current() == '[' || (set = jsonReader.nextIfSet())) {
133134
JSONReader.Context ctx = context;
134135
ObjectReader itemObjectReader = null;
135136

@@ -173,6 +174,8 @@ public void readFieldValue(JSONReader jsonReader, T object) {
173174
if (list == null) {
174175
if (fieldClass == java.util.List.class) {
175176
list = new ArrayList(i);
177+
} else if (set && fieldClass == Collection.class) {
178+
list = new LinkedHashSet();
176179
} else {
177180
list = (Collection) this.fieldObjectReader.createInstance(context.getFeatures() | features);
178181
}

0 commit comments

Comments
 (0)