From 8b5f3402e2526710af754be4170d225348a0ba8b Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 7 Mar 2020 20:20:36 +0000 Subject: [PATCH] Rename getAccess to getMethodAccess Signed-off-by: Graham --- .../main/java/dev/openrs2/asm/classpath/AsmClassMetadata.kt | 2 +- asm/src/main/java/dev/openrs2/asm/classpath/ClassMetadata.kt | 2 +- .../java/dev/openrs2/asm/classpath/ReflectionClassMetadata.kt | 2 +- deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt | 4 ++-- .../java/dev/openrs2/deob/transform/VisibilityTransformer.kt | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/asm/src/main/java/dev/openrs2/asm/classpath/AsmClassMetadata.kt b/asm/src/main/java/dev/openrs2/asm/classpath/AsmClassMetadata.kt index c1222426..563277f5 100644 --- a/asm/src/main/java/dev/openrs2/asm/classpath/AsmClassMetadata.kt +++ b/asm/src/main/java/dev/openrs2/asm/classpath/AsmClassMetadata.kt @@ -27,7 +27,7 @@ class AsmClassMetadata( override val methods get() = clazz.methods.map(::MemberDesc) - override fun getAccess(method: MemberDesc): Int? { + override fun getMethodAccess(method: MemberDesc): Int? { return clazz.methods.find { it.name == method.name && it.desc == method.desc }?.access } } diff --git a/asm/src/main/java/dev/openrs2/asm/classpath/ClassMetadata.kt b/asm/src/main/java/dev/openrs2/asm/classpath/ClassMetadata.kt index e82a85a7..111565c5 100644 --- a/asm/src/main/java/dev/openrs2/asm/classpath/ClassMetadata.kt +++ b/asm/src/main/java/dev/openrs2/asm/classpath/ClassMetadata.kt @@ -11,7 +11,7 @@ abstract class ClassMetadata { abstract val fields: List abstract val methods: List - abstract fun getAccess(method: MemberDesc): Int? + abstract fun getMethodAccess(method: MemberDesc): Int? fun isOverride(method: MemberDesc): Boolean { val superClass = this.superClass diff --git a/asm/src/main/java/dev/openrs2/asm/classpath/ReflectionClassMetadata.kt b/asm/src/main/java/dev/openrs2/asm/classpath/ReflectionClassMetadata.kt index 42d209c1..231e6e3e 100644 --- a/asm/src/main/java/dev/openrs2/asm/classpath/ReflectionClassMetadata.kt +++ b/asm/src/main/java/dev/openrs2/asm/classpath/ReflectionClassMetadata.kt @@ -29,7 +29,7 @@ class ReflectionClassMetadata(private val classPath: ClassPath, private val claz override val methods get() = clazz.declaredMethods.map { MemberDesc(it.name, Type.getMethodDescriptor(it)) } - override fun getAccess(method: MemberDesc): Int? { + override fun getMethodAccess(method: MemberDesc): Int? { return clazz.declaredMethods.find { it.name == method.name && Type.getMethodDescriptor(it) == method.desc } ?.modifiers } diff --git a/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt b/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt index ac537a24..ff376668 100644 --- a/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt +++ b/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt @@ -124,7 +124,7 @@ class TypedRemapper private constructor( } for (method in clazz.methods) { - if (clazz.getAccess(method)!! and Opcodes.ACC_NATIVE != 0) { + if (clazz.getMethodAccess(method)!! and Opcodes.ACC_NATIVE != 0) { return false } } @@ -247,7 +247,7 @@ class TypedRemapper private constructor( return false } - val access = clazz.getAccess(MemberDesc(method)) + val access = clazz.getMethodAccess(MemberDesc(method)) if (access != null && access and Opcodes.ACC_NATIVE != 0) { return false } diff --git a/deob/src/main/java/dev/openrs2/deob/transform/VisibilityTransformer.kt b/deob/src/main/java/dev/openrs2/deob/transform/VisibilityTransformer.kt index b2bd45b2..517fd34a 100644 --- a/deob/src/main/java/dev/openrs2/deob/transform/VisibilityTransformer.kt +++ b/deob/src/main/java/dev/openrs2/deob/transform/VisibilityTransformer.kt @@ -95,7 +95,7 @@ class VisibilityTransformer : Transformer() { return if (overridable) { // reduce it to the weakest level required to override a dependency's method partition.filter { classPath[it.owner]!!.dependency } - .mapNotNull { classPath[it.owner]!!.getAccess(MemberDesc(it)) } + .mapNotNull { classPath[it.owner]!!.getMethodAccess(MemberDesc(it)) } .fold(visibility, ::weakestVisibility) } else { visibility