Fix to addArchiveTask only removes suffix at the end#32639
Merged
blindpirate merged 2 commits intogradle:releasefrom Mar 12, 2025
Merged
Fix to addArchiveTask only removes suffix at the end#32639blindpirate merged 2 commits intogradle:releasefrom
blindpirate merged 2 commits intogradle:releasefrom
Conversation
minus() method incorrectly removed the first occurrence of a given suffix so make new method, removeLast() in TextUtil, which correctly removes only the last occurrence of a given suffix if it appears at the end of the string. Signed-off-by: NaMinhyeok <[email protected]>
NaMinhyeok
commented
Mar 8, 2025
...s-distribution/src/main/java/org/gradle/api/distribution/plugins/DistributionBasePlugin.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Collaborator
|
The following builds have failed: |
ghale
requested changes
Mar 11, 2025
platforms/core-runtime/base-services/src/main/java/org/gradle/util/internal/TextUtil.java
Outdated
Show resolved
Hide resolved
...s-distribution/src/main/java/org/gradle/api/distribution/plugins/DistributionBasePlugin.java
Outdated
Show resolved
Hide resolved
Member
|
Thanks for the PR @NaMinhyeok. I think this looks good. Let's just rename the method (for clarity) and we'll get this tested and merged into 8.14. |
Signed-off-by: NaMinhyeok <[email protected]>
Member
|
@bot-gradle test this |
This comment has been minimized.
This comment has been minimized.
ghale
approved these changes
Mar 11, 2025
Collaborator
|
The following builds have passed: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
minus() method incorrectly removed the first occurrence of a given suffix so make new method, removeLast() in TextUtil, which correctly removes only the last occurrence of a given suffix if it appears at the end of the string.
Context
The previous implementation of
TextUtil.minus()incorrectly removed the first occurrence of a given suffix in a string, causing unintended modifications when the suffix appeared in the middle of the string.To fix this, I introduced a new method,
TextUtil.removeLast(), which ensures that only the last occurrence of a given suffix is removed if it appears at the end of the string.Additionally, I updated
DistributionBasePlugin.javato useremoveLast()instead ofminus().Contributor Checklist
<subproject>/src/integTest) to verify changes from a user perspective.<subproject>/src/test) to verify logic../gradlew sanityCheck../gradlew <changed-subproject>:quickTest.Reviewing cheatsheet
Before merging the PR, comments starting with