Rename getAccess to getMethodAccess

Signed-off-by: Graham <gpe@openrs2.dev>
master
Graham 5 years ago
parent 626202b451
commit 8b5f3402e2
  1. 2
      asm/src/main/java/dev/openrs2/asm/classpath/AsmClassMetadata.kt
  2. 2
      asm/src/main/java/dev/openrs2/asm/classpath/ClassMetadata.kt
  3. 2
      asm/src/main/java/dev/openrs2/asm/classpath/ReflectionClassMetadata.kt
  4. 4
      deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt
  5. 2
      deob/src/main/java/dev/openrs2/deob/transform/VisibilityTransformer.kt

@ -27,7 +27,7 @@ class AsmClassMetadata(
override val methods override val methods
get() = clazz.methods.map(::MemberDesc) 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 return clazz.methods.find { it.name == method.name && it.desc == method.desc }?.access
} }
} }

@ -11,7 +11,7 @@ abstract class ClassMetadata {
abstract val fields: List<MemberDesc> abstract val fields: List<MemberDesc>
abstract val methods: List<MemberDesc> abstract val methods: List<MemberDesc>
abstract fun getAccess(method: MemberDesc): Int? abstract fun getMethodAccess(method: MemberDesc): Int?
fun isOverride(method: MemberDesc): Boolean { fun isOverride(method: MemberDesc): Boolean {
val superClass = this.superClass val superClass = this.superClass

@ -29,7 +29,7 @@ class ReflectionClassMetadata(private val classPath: ClassPath, private val claz
override val methods override val methods
get() = clazz.declaredMethods.map { MemberDesc(it.name, Type.getMethodDescriptor(it)) } 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 } return clazz.declaredMethods.find { it.name == method.name && Type.getMethodDescriptor(it) == method.desc }
?.modifiers ?.modifiers
} }

@ -124,7 +124,7 @@ class TypedRemapper private constructor(
} }
for (method in clazz.methods) { 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 return false
} }
} }
@ -247,7 +247,7 @@ class TypedRemapper private constructor(
return false return false
} }
val access = clazz.getAccess(MemberDesc(method)) val access = clazz.getMethodAccess(MemberDesc(method))
if (access != null && access and Opcodes.ACC_NATIVE != 0) { if (access != null && access and Opcodes.ACC_NATIVE != 0) {
return false return false
} }

@ -95,7 +95,7 @@ class VisibilityTransformer : Transformer() {
return if (overridable) { return if (overridable) {
// reduce it to the weakest level required to override a dependency's method // reduce it to the weakest level required to override a dependency's method
partition.filter { classPath[it.owner]!!.dependency } partition.filter { classPath[it.owner]!!.dependency }
.mapNotNull { classPath[it.owner]!!.getAccess(MemberDesc(it)) } .mapNotNull { classPath[it.owner]!!.getMethodAccess(MemberDesc(it)) }
.fold(visibility, ::weakestVisibility) .fold(visibility, ::weakestVisibility)
} else { } else {
visibility visibility

Loading…
Cancel
Save