From e9fc11863f49578396700e7d535f9fdaae5ba197 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Mar 2026 10:01:32 +0000 Subject: [PATCH] Use removePrefix instead of replace for multi-release prefix removal Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com> --- .../jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.kt index 1cb0039c3..6c2837fac 100644 --- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.kt +++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.kt @@ -177,8 +177,8 @@ constructor( with(fileDetails) { // Temporarily remove the multi-release prefix. val multiReleasePrefix = multiReleaseRegex.find(path)?.value.orEmpty() - val newPath = path.replace(multiReleasePrefix, "") - val relocatedPath = multiReleasePrefix + relocators.relocatePath(newPath) + val pathSuffix = path.removePrefix(multiReleasePrefix) + val relocatedPath = multiReleasePrefix + relocators.relocatePath(pathSuffix) writeToZip(entryName = relocatedPath, bytes = remapClass(relocators = relocators)) } }