Do not store duplicate keyed list entry fields

Description

As a follow-up to MDSAL-374, make sure we do not instantiate the entry key eagerly, but rather postpone its instantiation to when it is actually requested.

This means the accessor needs to be thread-safe and we need to check that all constituent fields are initialized to non-null - otherwise we need to throw an IllegalStateException.

Rather than solving this for Builders, we want to solve this in individual implementations. Here the fact that AbstractEntryObject holds a non-null key helps: all accessors can just prepend 'key().' and not reference fields.

Activity

Show:

Robert Varga October 15, 2018 at 9:19 AM
Edited

I think that is a better solution.

Robert Varga October 10, 2018 at 5:58 PM

As an alternative we can continue to calculate the key eagerly, but then not generate fields for key constituents and generate their getters as forwarders, i.e. we store their values only in the key object.

Details

Assignee

Reporter

Labels

Components

Fix versions

Priority

Created October 10, 2018 at 4:33 PM
Updated March 10, 2025 at 9:21 AM
Loading...