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) {
|
private FqName getWrapperName(@NotNull JetFile containingFile) {
|
||||||
FqName packageClassFqName = PackageClassUtils.getPackageClassFqName(containingFile.getPackageFqName());
|
FqName packageClassFqName = PackageClassUtils.getPackageClassFqName(containingFile.getPackageFqName());
|
||||||
JavaClassDescriptor descriptor = samType.getJavaClassDescriptor();
|
JavaClassDescriptor descriptor = samType.getJavaClassDescriptor();
|
||||||
String shortName = packageClassFqName.shortName().asString() + "$sam$" + descriptor.getName().asString() + "$" +
|
int hash = PackagePartClassUtils.getPathHashCode(containingFile.getVirtualFile()) * 31 +
|
||||||
Integer.toHexString(
|
DescriptorUtils.getFqNameSafe(descriptor).hashCode();
|
||||||
PackagePartClassUtils.getPathHashCode(containingFile.getVirtualFile()) * 31 +
|
String shortName = String.format(
|
||||||
DescriptorUtils.getFqNameSafe(descriptor).hashCode()
|
"%s$sam$%s$%08x",
|
||||||
);
|
packageClassFqName.shortName().asString(),
|
||||||
|
descriptor.getName().asString(),
|
||||||
|
hash
|
||||||
|
);
|
||||||
return packageClassFqName.parent().child(Name.identifier(shortName));
|
return packageClassFqName.parent().child(Name.identifier(shortName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user