-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
Hi @dabeeeenster ,
We are using this library with kotlin and we are getting exceptions when the feature flag list needs to be extended because the flag is missing in the server. The reason is that the feature flag list is created as immutable.
Here is where the code needs to be fixed:
file: FlagsmithApiWrapper.java
// from:
List<Flag> featureFlags = Arrays.asList(mapper.readValue(response.body().string(),
Flag[].class));
// to:
List<Flag> featureFlags = new ArrayList<>(Arrays.asList(
mapper.readValue(response.body().string(),
Flag[].class)));
Maybe you should double check everywhere where Arrays.asList is used (as this creates an immutable list). If the list needs to be modifiable then wrapping it with new ArrayList<>() should fix it (this creates a mutable list).
Cheers,
Olga
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels