We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfc549b commit eddf91fCopy full SHA for eddf91f
1 file changed
grease/src/main/kotlin/io/deepmedia/tools/grease/files.kt
@@ -43,7 +43,7 @@ val File.packageNames: Set<String>
43
if (file.name != "module-info.class") {
44
val cleanedPath = file.path.removePrefix(this.path).removePrefix("/")
45
cleanedPath
46
- .substring(0 until cleanedPath.lastIndexOf('/'))
47
- .replace('/', '.')
+ .substring(0 until cleanedPath.lastIndexOf('/').coerceAtLeast(0))
+ .replace('/', '.').takeIf { it.isNotBlank() }
48
} else null
49
}.toSet()
0 commit comments