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

AnnotatedCreatorCollector should avoid processing synthetic static (factory) methods #2928

Conversation

carterkozak
Copy link
Contributor

This implementation matches the AnnotatedMethodCollector which
also avoids synthetic methods. In the debugger I found most
iterations through _findPotentialFactories were checking synthetic
methods from lambdas rather than human-declared methods.

@cowtowncoder
Copy link
Member

Quick question: is there specific bug fixed (if so, would be great to have a unit test), or is it optimization?
Both are fine, but if latter, I'd prefer rebase against 2.12 just to minimize any risk (seems like there's non-zero risk here).

@carterkozak
Copy link
Contributor Author

Quick question: is there specific bug fixed (if so, would be great to have a unit test), or is it optimization?

I haven't encountered a specific bug, but I'm not confident that this couldn't result in a bug (and it would be mind-bending to debug!). If the static method requires a specific name or annotation to be used as a factory when no other creators exist, it should be fine to target 2.12.
Happy to target into 2.12 for now, and we can backport if there's a failure it resolves.

@cowtowncoder
Copy link
Member

@carterkozak yeah let's do 2.12 then -- I am ok with minor risk for new minor versions.

@carterkozak carterkozak force-pushed the ckozak/creator_collector_skips_synthetic branch from ef1d08e to 080be76 Compare November 9, 2020 21:16
@carterkozak carterkozak changed the base branch from 2.11 to 2.12 November 9, 2020 21:20
@carterkozak
Copy link
Contributor Author

Sounds good, I've updated the target.

@cowtowncoder cowtowncoder merged commit f41d554 into FasterXML:2.12 Nov 9, 2020
@cowtowncoder cowtowncoder changed the title AnnotatedCreatorCollector avoids processing synthetic methods AnnotatedCreatorCollector should avoid processing synthetic static (factory) methods Nov 9, 2020
@cowtowncoder cowtowncoder added this to the 2.12.0-rc2 milestone Nov 9, 2020
cowtowncoder added a commit that referenced this pull request Nov 9, 2020
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.

None yet

2 participants