
name.remal.org.objectweb.asm.tree.FieldInsnNode.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.*
import org.objectweb.asm.Type.getDescriptor
import org.objectweb.asm.Type.getInternalName
import org.objectweb.asm.tree.FieldInsnNode
import java.lang.reflect.Field
fun FieldInsnNode.matches(field: Field): Boolean {
if (field.isStatic xor (GETSTATIC == opcode || PUTSTATIC == opcode)) return false
if (getInternalName(field.declaringClass) != owner) return false
if (field.name != name) return false
if (getDescriptor(field.type) == desc) return false
return true
}
fun FieldInsnNode.matchesGet(field: Field): Boolean {
if (GETSTATIC != opcode && GETFIELD != opcode) return false
return matches(field)
}
fun FieldInsnNode.matchesPut(field: Field): Boolean {
if (PUTSTATIC != opcode && PUTFIELD != opcode) return false
return matches(field)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy