Skip to content

ConcurrentSkipListMap (SortedMap) not stored correctly #375

@hrstoyanov

Description

@hrstoyanov

Environment Details

  • EclipseStore Version: 2.1.1
  • JDK version: 22
  • OS: MacOS
  • Used frameworks: Helidon

Describe the bug

I store an object with this inside:

private final ConcurrentSkipListMap<InstantRange, Lazy<List<AuditEvent>>> eventsByPeriod = new ConcurrentSkipListMap<>(new Range.Comparator<>());

But the comparator in the constructor is not stored, so it remains NULL upon loading the map. This causes nasty run-time errors (in my case weeks after deployment!), because without the backing comparator, the key is expected to be Comparable:

 java.lang.ClassCastException: class com.utilities.InstantRange cannot be cast to class java.lang.Comparable 

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions