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

Fix #5511: don't anymore rely on CodeSource#getLocation() #5519

Open
wants to merge 8 commits into
base: 4.0
Choose a base branch
from

Conversation

BalusC
Copy link
Contributor

@BalusC BalusC commented Oct 19, 2024

Fix #5511: don't anymore rely on CodeSource#getLocation(), instead obtain the URL of the resource itself via its own class loader

obtain the URL of the resource itself via its own class loader
if (annotatedSet != null) {
for (Class<?> clazz : annotatedSet) {
if (sourceURIString.contains(clazz.getProtectionDomain().getCodeSource().getLocation().toString())) {
String jarURIString = CURRENT_RESOURCE_IN_JAR_PATTERN.split(clazz.getResource(".").toString(), 2)[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

Not seeing a test here that validates this change over?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added integration test: 1ff6714

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