Skip to content

[OPENJPA-2958] Add ImplHelper.registerUnenhancedInstance() - #170

Open
rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2958
Open

[OPENJPA-2958] Add ImplHelper.registerUnenhancedInstance()#170
rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2958

Conversation

@rzo1

@rzo1 rzo1 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

BrokerImpl reached into the public mutable ImplHelper._unenhancedInstanceMap to register the persistence-capable instance of an unenhanced one. This adds a method for it and routes all three write sites through it, so the registry is no longer written to from outside the class that owns it. Behaviour is unchanged — the method is the same overwriting put.

The field is deprecated to point callers at the method, but stays public. Its type is a reference type, so it is never inlined into callers, and making it private would surface as a NoSuchFieldError at runtime for anything compiled against 4.1.x rather than as a compile error on upgrade. That belongs in a major release.

BrokerImpl reached into the public mutable ImplHelper._unenhancedInstanceMap
to register the persistence capable instance of an unenhanced one. Add a
method for it and route all three write sites through it, so the registry
is no longer written to from outside the class that owns it. Behaviour is
unchanged: the method is the same overwriting put.

The field is deprecated to point callers at the method. It stays public:
its type is a reference type, so it is never inlined into callers, and
making it private would turn into a NoSuchFieldError at runtime for
anything compiled against 4.1.x rather than a compile error on upgrade.
Making it private belongs in a major release.
@rzo1 rzo1 self-assigned this Aug 29, 2026
@rzo1
rzo1 requested review from cristof and solomax August 29, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants