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

Do not use endsWith on Path object for string comparison #46711

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

holly-cummins
Copy link
Contributor

@holly-cummins holly-cummins commented Mar 10, 2025

Resolves #46704.

I misunderstood how endsWith on a Path works; it only looks at whole path elements. As a result, a little 'optimisation' in #46625 broke tests in jars by causing the 'is this a jar?' branch to be bypassed.

We probably should have a test for this which catches the issue without needing to go to the JBeret ecosystem CI, but I'll add that separately, so that we can get this fix in ASAP.

@holly-cummins holly-cummins requested a review from radcortez March 10, 2025 22:10
@holly-cummins holly-cummins changed the title Do not use endsWith on path for string comparison Do not use endsWith on Path object for string comparison Mar 10, 2025
Copy link

quarkus-bot bot commented Mar 11, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 32de66c.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

Ah ah, I got hit by that too a few months ago :).

@gsmet gsmet merged commit b80ba0d into quarkusio:main Mar 11, 2025
58 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.21 - main milestone Mar 11, 2025
@holly-cummins
Copy link
Contributor Author

Ah ah, I got hit by that too a few months ago :).

I was so pleased with myself for making the code more efficient by avoiding an unnecessary toString() call. Then I was so annoyed with myself for not reading the Javadoc to confirm the method did what I thought it did. Glad it isn't just me who made that bad assumption!

@radcortez
Copy link
Member

I confirm that it fixes the issue. Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestPathHelper signature change causing issue on JBeret ecosystem CI
4 participants