Files
floci/src/test/java/io/github
TiM 677bad0e16 fix(storage): make scan() return mutable list for non-InMemory backends (#517)
PersistentStorage, HybridStorage, and WalStorage used Stream.toList(),
which returns an unmodifiable list in Java 16+. InMemoryStorage built an
ArrayList, so callers that mutate the scan result work in unit tests
(all using in-memory backend) but fail at runtime on persistent backends.

This was the root cause of #482: CloudWatchLogsService.describeLogGroups
calls result.sort(...) on the scan result, which throws
UnsupportedOperationException when running against any non-memory store.
Same latent bug at CloudWatchLogsService.getLogEvents and
CognitoService.listGroups (callers copy into ArrayList first, so they
happen to work).

Rather than patch the two call sites, align all StorageBackend
implementations on a documented "returns a new mutable list" contract.
Tests added to each backend to lock in the behavior.
2026-04-18 18:36:20 -05:00
..