Skip to content

Commit 79e6247

Browse files
GooolerCopilot
andauthored
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 81796bf commit 79e6247

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/RelocatorRemapper.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@ internal class RelocatorRemapper(
2727

2828
override fun map(internalName: String): String = mapName(internalName)
2929

30-
fun mapPath(path: String): String = map(path.substring(0, path.indexOf('.')))
30+
fun mapPath(path: String): String {
31+
val dotIndex = path.indexOf('.')
32+
return if (dotIndex == -1) {
33+
path // Return the original path if no period is found
34+
} else {
35+
map(path.substring(0, dotIndex))
36+
}
37+
}
3138

3239
private fun mapName(name: String, mapLiterals: Boolean = false): String {
3340
var newName = name

0 commit comments

Comments
 (0)