eclipse-emfcloud / emfjson-jackson

emfjson-jackson
Other
16 stars 15 forks source link

Fix infinite loop when object is given instead of array #24

Closed janhicken closed 2 years ago

janhicken commented 2 years ago

If a JSON contained an object instead of an array for a given reference that expects an array normally, the EObjectDeserializer will hang in an infinite loop eventually resulting in an out of memory error.

This fixes the issue by throwing an exception, when an unexpected token is encountered while parsing a many-valued feature.

The bug can be reproduced with the added test case.

The bug is very similar to this PR's solution.