diff --git a/compiler/testData/codegen/bytecodeListing/samAdapterAndInlinedOne.kt b/compiler/testData/codegen/bytecodeListing/samAdapterAndInlinedOne.kt index 30bb55ba822..55e63be845c 100644 --- a/compiler/testData/codegen/bytecodeListing/samAdapterAndInlinedOne.kt +++ b/compiler/testData/codegen/bytecodeListing/samAdapterAndInlinedOne.kt @@ -16,8 +16,4 @@ fun noInline(lambda: ()->Unit) : Runnable { fun noInline2(lambda: ()->Unit) : Runnable { return Runnable(lambda) -} - -// 1 final class test/_1Kt\$sam\$Runnable\$89f9321c -// 1 public final class test/_1Kt\$sam\$Runnable\$i\$89f9321c -// 2 class test/_1Kt\$sam\$ \ No newline at end of file +} \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeListing/samAdapterAndInlinedOne.txt b/compiler/testData/codegen/bytecodeListing/samAdapterAndInlinedOne.txt index a8edacd3495..a6d6cdaae71 100644 --- a/compiler/testData/codegen/bytecodeListing/samAdapterAndInlinedOne.txt +++ b/compiler/testData/codegen/bytecodeListing/samAdapterAndInlinedOne.txt @@ -1,12 +1,12 @@ @kotlin.Metadata -final class test/SamAdapterAndInlinedOneKt$sam$Runnable$82391ccd { +final class test/SamAdapterAndInlinedOneKt$sam$Runnable$HASH { private synthetic final field function: kotlin.jvm.functions.Function0 method (p0: kotlin.jvm.functions.Function0): void public synthetic final method run(): void } @kotlin.Metadata -public final class test/SamAdapterAndInlinedOneKt$sam$Runnable$i$82391ccd { +public final class test/SamAdapterAndInlinedOneKt$sam$Runnable$i$HASH { private synthetic final field function: kotlin.jvm.functions.Function0 public method (p0: kotlin.jvm.functions.Function0): void public synthetic final method run(): void @@ -18,4 +18,4 @@ public final class test/SamAdapterAndInlinedOneKt { public final static @org.jetbrains.annotations.NotNull method makeRunnable2(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Runnable public final static @org.jetbrains.annotations.NotNull method noInline(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Runnable public final static @org.jetbrains.annotations.NotNull method noInline2(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Runnable -} +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeListingTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeListingTest.kt index 997feca86bc..5ec3d64b610 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeListingTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeListingTest.kt @@ -34,7 +34,7 @@ abstract class AbstractBytecodeListingTest : CodegenTestCase() { val cr = ClassReader(it.asByteArray()) val visitor = TextCollectingVisitor() cr.accept(visitor, ClassReader.SKIP_CODE) - visitor.text + KotlinTestUtils.replaceHash(visitor.text, "HASH") }.joinToString("\n\n") KotlinTestUtils.assertEqualsToFile(txtFile, generatedFiles) diff --git a/compiler/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java b/compiler/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java index a096cb81764..058a3ebe315 100644 --- a/compiler/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java +++ b/compiler/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java @@ -950,10 +950,14 @@ public class KotlinTestUtils { @NotNull public static String replaceHashWithStar(@NotNull String string) { + return replaceHash(string, "*"); + } + + public static String replaceHash(@NotNull String string, @NotNull String replacement) { //TODO: hashes are still used in SamWrapperCodegen Matcher matcher = STRIP_PACKAGE_PART_HASH_PATTERN.matcher(string); if (matcher.find()) { - return matcher.replaceAll("\\$*"); + return matcher.replaceAll("\\$" + replacement); } return string; }