-
Notifications
You must be signed in to change notification settings - Fork 6
Description
If a transformation returns an empty transformation (not null and not an empty list, equivalent of { } for JSON), a ClassCastException is thrown and the following comes out in the logs:
class java.util.HashMap cannot be cast to class java.util.List (java.util.HashMap and java.util.List are in module java.base of loader 'bootstrap')
The issue seems to be at com.swisscom.daisy.cosmos.candyfloss.transformations.Transformer:35 which is the transformList() method. There is an unsafe cast at line 36:
var transformed = (List<Map<String, Object>>) chainr.transform(input.json());
The code checks to see if this returns null but not an empty HashMap. Not entirely sure why an empty HashMap gets returned instead of null but that is somewhat separate from this
Thanks,
Sean