Prepend zeros to package part hash code

This commit is contained in:
Alexander Udalov
2014-09-25 17:42:17 +04:00
parent e2273a3d85
commit 80a7c64369
2 changed files with 8 additions and 4 deletions
@@ -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));
}