Skip to content

Fix #6187: make AnnotatedConstructor InvokerHolder access lazy - #6191

Open
kalayciburak wants to merge 2 commits into
FasterXML:3.xfrom
kalayciburak:6187-lazy-constructor-invokers
Open

Fix #6187: make AnnotatedConstructor InvokerHolder access lazy#6191
kalayciburak wants to merge 2 commits into
FasterXML:3.xfrom
kalayciburak:6187-lazy-constructor-invokers

Conversation

@kalayciburak

Copy link
Copy Markdown
Contributor

Fixes #6187

AnnotatedConstructor built three InvokerHolders in the instance initializer even though most constructors never use all of call(), call1(), and call(Object[]). UnreflectHandleSupplier already defers the MethodHandle, but constructing the holders still eagerly creates MethodTypes.

Holders are now volatile and created on first use, same racy-publication pattern as _paramClasses. call(), call1(), and call(Object[]) behavior is unchanged.

Tests

Construct nullary, unary, and fixed-arity invokers on first use instead
of at AnnotatedConstructor creation. Most instances never call all three
paths, so this avoids the extra MethodType and holder work during
introspection.
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 81.96% 📈 +0.010%
Branches branches 75.61% 📈 +0.010%

Coverage data generated from JaCoCo test results

@gitar-bot

gitar-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Defers InvokerHolder creation in AnnotatedConstructor to first use instead of eagerly constructing all three in the instance initializer, reducing initialization overhead for constructors that don't use all call variants. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 81.96% 📈 +0.010%
Branches branches 75.59% 📈 +0.040%

Coverage data generated from JaCoCo test results

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.

Make InvokerHolder access in AnnotatedConstructor lazy, to reduce unnecessary eager processing

2 participants