Prepend zeros to SAM wrapper hash code
To make its length always 8 characters as is already done for package parts. This fixes some test on incremental compilation because it relies that hashes are eight characters long
This commit is contained in:
@@ -171,11 +171,14 @@ public class SamWrapperCodegen {
|
||||
private FqName getWrapperName(@NotNull JetFile containingFile) {
|
||||
FqName packageClassFqName = PackageClassUtils.getPackageClassFqName(containingFile.getPackageFqName());
|
||||
JavaClassDescriptor descriptor = samType.getJavaClassDescriptor();
|
||||
String shortName = packageClassFqName.shortName().asString() + "$sam$" + descriptor.getName().asString() + "$" +
|
||||
Integer.toHexString(
|
||||
PackagePartClassUtils.getPathHashCode(containingFile.getVirtualFile()) * 31 +
|
||||
DescriptorUtils.getFqNameSafe(descriptor).hashCode()
|
||||
);
|
||||
int hash = PackagePartClassUtils.getPathHashCode(containingFile.getVirtualFile()) * 31 +
|
||||
DescriptorUtils.getFqNameSafe(descriptor).hashCode();
|
||||
String shortName = String.format(
|
||||
"%s$sam$%s$%08x",
|
||||
packageClassFqName.shortName().asString(),
|
||||
descriptor.getName().asString(),
|
||||
hash
|
||||
);
|
||||
return packageClassFqName.parent().child(Name.identifier(shortName));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user