From 88a325257494939a79fb30dd51d60c5c52546755 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 7 Dec 2024 06:18:52 +0100 Subject: [PATCH] feat: Add identity hash code to unnamed patches --- src/main/kotlin/app/revanced/patcher/patch/Patch.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/app/revanced/patcher/patch/Patch.kt b/src/main/kotlin/app/revanced/patcher/patch/Patch.kt index 8f0dc838..39d27b3e 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/Patch.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/Patch.kt @@ -87,7 +87,8 @@ sealed class Patch>( finalizeBlock?.invoke(context) } - override fun toString() = name ?: "Patch" + override fun toString() = name ?: + "Patch@${System.identityHashCode(this)}" } internal fun Patch<*>.anyRecursively( @@ -161,7 +162,7 @@ class BytecodePatch internal constructor( override fun finalize(context: PatcherContext) = finalize(context.bytecodeContext) - override fun toString() = name ?: "BytecodePatch" + override fun toString() = name ?: "Bytecode${super.toString()}" } /** @@ -204,7 +205,7 @@ class RawResourcePatch internal constructor( override fun finalize(context: PatcherContext) = finalize(context.resourceContext) - override fun toString() = name ?: "RawResourcePatch" + override fun toString() = name ?: "RawResource${super.toString()}" } /** @@ -247,7 +248,7 @@ class ResourcePatch internal constructor( override fun finalize(context: PatcherContext) = finalize(context.resourceContext) - override fun toString() = name ?: "ResourcePatch" + override fun toString() = name ?: "Resource${super.toString()}" } /**