- Common ways to obtain FieldInsnNode
private void myMethod () {FieldInsnNode f =
String owner;String name;String descriptor;new FieldInsnNode(opcode, owner, name, descriptor)
- Smart code suggestions by Codota
}
@Override protected AbstractInsnNode transformFieldInsnNode(MethodNode mn, FieldInsnNode fieldNode) { // This handles the else branch for field assignments if (DescriptorMapping.getInstance().isTransformedOrBooleanField(this.booleanTestabilityTransformation.className, fieldNode.name, fieldNode.desc)) { if (fieldNode.getNext() instanceof FieldInsnNode) { FieldInsnNode other = (FieldInsnNode) fieldNode.getNext(); if (fieldNode.owner.equals(other.owner) && fieldNode.name.equals(other.name) && fieldNode.desc.equals(other.desc)) { if (fieldNode.getOpcode() == Opcodes.GETFIELD && other.getOpcode() == Opcodes.PUTFIELD) { this.booleanTestabilityTransformation.insertGetBefore(other, mn.instructions); } else if (fieldNode.getOpcode() == Opcodes.GETSTATIC && other.getOpcode() == Opcodes.PUTSTATIC) { this.booleanTestabilityTransformation.insertGetBefore(other, mn.instructions); } } } } return fieldNode; }
AbstractInsnNode next = field.getNext(); if (next == null || next.getOpcode() != Opcodes.INVOKEVIRTUAL) { return;
AbstractInsnNode next = field.getNext(); if (next == null || next.getOpcode() != Opcodes.INVOKEVIRTUAL) { return;