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

HHH-19229 Faster checks in ReflectHelper #9835

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

obourgain
Copy link

@obourgain obourgain commented Mar 4, 2025

Make the checks in ReflectHelper faster.
See detailed description in Jira


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Mar 4, 2025

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

@obourgain obourgain force-pushed the HHH-19229_faster_checks_in_ReflectHelper branch from 8185714 to 247843c Compare March 4, 2025 15:33
@obourgain
Copy link
Author

pipeline seems to be stuck
image

@sebersole
Copy link
Member

The oracle job failure is an occasional, transient problem - probably not anything wrong with your PR.

The code analysis though you will need to resolve.

@obourgain obourgain force-pushed the HHH-19229_faster_checks_in_ReflectHelper branch from 247843c to 4168f91 Compare March 11, 2025 07:04
@obourgain obourgain force-pushed the HHH-19229_faster_checks_in_ReflectHelper branch from 4168f91 to 789d3c9 Compare March 11, 2025 07:05
Copy link
Member

@mbladel mbladel left a comment

Choose a reason for hiding this comment

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

Left a couple comments. I found it weird that tests were passing since the checks you implemented were not correct, and I found some duplicated logic in org.hibernate.property.access.internal.AccessStrategyHelper#checkIsMethodVariant.

Could you please delete this method and ensure we use ReflectHelper#verifyNoIsVariantExists instead?

Comment on lines +579 to +580
&& declaredMethod.getName().startsWith("is")
&& declaredMethod.getName().regionMatches(0, stemName, 0, stemName.length() )
Copy link
Member

Choose a reason for hiding this comment

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

Code style and correct region-matching.

Suggested change
&& declaredMethod.getName().startsWith("is")
&& declaredMethod.getName().regionMatches(0, stemName, 0, stemName.length() )
&& declaredMethod.getName().startsWith( "is" )
&& declaredMethod.getName().regionMatches( 2, stemName, 0, stemName.length() )

Comment on lines +618 to +619
&& declaredMethod.getName().startsWith("is")
&& declaredMethod.getName().regionMatches(0, stemName, 0, stemName.length() )
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
&& declaredMethod.getName().startsWith("is")
&& declaredMethod.getName().regionMatches(0, stemName, 0, stemName.length() )
&& declaredMethod.getName().startsWith( "get" )
&& declaredMethod.getName().regionMatches( 3, stemName, 0, stemName.length() )

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.

3 participants