Prepend zeros to package part hash code
This commit is contained in:
+6
-2
@@ -56,8 +56,12 @@ public class PackagePartClassUtils {
|
||||
String fileName = FileUtil.getNameWithoutExtension(PathUtil.getFileName(file.getName()));
|
||||
|
||||
// path hashCode to prevent same name / different path collision
|
||||
String srcName = facadeFqName.shortName().asString() + "$" + replaceSpecialSymbols(fileName) + "$" + Integer.toHexString(
|
||||
getPathHashCode(file));
|
||||
String srcName = String.format(
|
||||
"%s$%s$%08x",
|
||||
facadeFqName.shortName().asString(),
|
||||
replaceSpecialSymbols(fileName),
|
||||
getPathHashCode(file)
|
||||
);
|
||||
|
||||
return facadeFqName.parent().child(Name.identifier(srcName));
|
||||
}
|
||||
|
||||
@@ -252,8 +252,8 @@ public abstract class AbstractIncrementalJpsTest : JpsBuildTestCase() {
|
||||
}
|
||||
|
||||
class object {
|
||||
// We suspect sequences of several consecutive hexadecimal digits to be a package part hash code
|
||||
val STRIP_PACKAGE_PART_HASH_PATTERN = Pattern.compile("\\$([0-9a-f]{5,8})")
|
||||
// We suspect sequences of eight consecutive hexadecimal digits to be a package part hash code
|
||||
val STRIP_PACKAGE_PART_HASH_PATTERN = Pattern.compile("\\$([0-9a-f]{8})")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user