Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setter/getter with a different type #10537

Merged
merged 2 commits into from
Feb 27, 2024
Merged

Allow setter/getter with a different type #10537

merged 2 commits into from
Feb 27, 2024

Conversation

dstepanov
Copy link
Contributor

No description provided.

@dstepanov dstepanov marked this pull request as draft February 23, 2024 15:45
@dstepanov dstepanov requested review from yawkat and graemerocher and removed request for yawkat February 27, 2024 12:06
@dstepanov dstepanov added the type: improvement A minor improvement to an existing feature label Feb 27, 2024
@dstepanov dstepanov marked this pull request as ready for review February 27, 2024 12:06
@dstepanov
Copy link
Contributor Author

Initially, I also wanted to separate annotations into read/write, based on the accessors, but that doesn't really work well with Jackson. I still kept the API in AST.

defaults,
loadTypeMethods
);

int typeLocal = -1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use Supplier.memoized

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh probably not more readable though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be more confusing; the invocation is contextual, and if a variable is not needed, we don't create it.

Copy link
Member

@yawkat yawkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this add significant size to the generated introspections?

defaults,
loadTypeMethods
);

int typeLocal = -1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh probably not more readable though

@dstepanov
Copy link
Contributor Author

Not much, considering we generate an additional argument only if the setter/getter value is different (in most cases, it shouldn't), plus it needs to be enabled.

Copy link

sonarcloud bot commented Feb 27, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
59.0% Coverage on New Code (required ≥ 70%)
3 New Critical Issues (required ≤ 0)
1 New Bugs (required ≤ 0)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@dstepanov dstepanov merged commit b343ba1 into 4.4.x Feb 27, 2024
14 of 15 checks passed
@dstepanov dstepanov deleted the introa branch February 27, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants