
name.remal.org.objectweb.asm.tree.MethodInsnNode.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common Show documentation
Show all versions of common Show documentation
Java & Kotlin tools: common
The newest version!
package name.remal
import org.objectweb.asm.Opcodes.INVOKESPECIAL
import org.objectweb.asm.Opcodes.INVOKESTATIC
import org.objectweb.asm.Type.*
import org.objectweb.asm.tree.MethodInsnNode
import java.lang.reflect.Constructor
import java.lang.reflect.Method
fun MethodInsnNode.matches(ctor: Constructor<*>): Boolean {
if (INVOKESPECIAL != opcode) return false
if (getInternalName(ctor.declaringClass) != owner) return false
if ("" != name) return false
if (getConstructorDescriptor(ctor) != desc) return false
return true
}
fun MethodInsnNode.matches(method: Method): Boolean {
if (INVOKESPECIAL == opcode) return false
if (method.isStatic xor (INVOKESTATIC == opcode)) return false
if (getInternalName(method.declaringClass) != owner) return false
if (method.name != name) return false
if (getMethodDescriptor(method) != desc) return false
return true
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy