Skip to content

HHH-19372 HHH-19369 Issues with access optimizer and inheritance #10075

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

dreab8
Copy link
Member

@dreab8 dreab8 commented Apr 23, 2025

https://hibernate.atlassian.net/browse/HHH-19372
https://hibernate.atlassian.net/browse/HHH-19369


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.


ChildEntity7.class
})
@SessionFactory
@Jira("https://hibernate.atlassian.net/browse/HHH-19059")
Copy link
Contributor

Choose a reason for hiding this comment

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

@dreab8 dreab8 force-pushed the HHH-19372 branch 3 times, most recently from bc6d831 to 1fbb926 Compare April 23, 2025 16:04
}
final URL url = codeSource.getLocation();
return url == null ? clazz.getName() : clazz.getName() + url.toString().hashCode();
return url == null ? className : className + url.toString().hashCode();
Copy link
Member

Choose a reason for hiding this comment

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

Just leaving a couple of notes here for the future:

  • hashCode() does not prevent possible collisions; I agree it would be extremely rare to have the same class multiple times, and also have conflicting hash-codes for their code source, but still could happen.
  • java.security.CodeSource access could be blocked via SecurityManager
  • bytecode enhanced classes return null here, though from some early testing we don't have any CCEs in that case; it would be great to understand why that works (my hypothesis would be we're using the byte code-enhanced class from byte-buddy in both PUs)

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