Skip to content

Commit 66efe24

Browse files
committed
fixes: jakartaee#344 CDI differs from non-CDI test
The SerializersCustomizationCDITest did assume a different behaviour than the non-CDI SerializersCustomizationTest.
1 parent 7340b84 commit 66efe24

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tck/src/main/java/ee/jakarta/tck/json/bind/cdi/customizedmapping/serializers/model/serializer/AnimalListDeserializerInjected.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2023 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -39,11 +39,16 @@ public class AnimalListDeserializerInjected
3939

4040
public List<Animal> deserialize(JsonParser jsonParser,
4141
DeserializationContext deserializationContext, Type type) {
42-
// start array
4342
List<Animal> animals = new ArrayList<>();
44-
while (jsonParser.next() == JsonParser.Event.START_OBJECT) {
45-
animals.add(animalDeserializer.deserialize(jsonParser,
46-
deserializationContext, type));
43+
44+
// start array
45+
while (jsonParser.hasNext()) {
46+
JsonParser.Event event = jsonParser.next();
47+
while (event == JsonParser.Event.START_OBJECT) {
48+
animals.add(animalDeserializer.deserialize(jsonParser,
49+
deserializationContext, type));
50+
event = jsonParser.next();
51+
}
4752
}
4853

4954
return animals;

0 commit comments

Comments
 (0)