Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/667'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mumfrey committed May 24, 2024
2 parents 02d7470 + 02bf3d2 commit 1bae530
Showing 1 changed file with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -638,25 +638,9 @@ public Iterator<AbstractInsnNode> iterator() {
*
* @param newNode NEW insn
* @return INVOKESPECIAL opcode of ctor, or null if not found
*
* @deprecated Use {@link #findInitNodeFor(TypeInsnNode, String)} instead:
* this method only matches the first matching <tt>&lt;init&gt;</tt>
* after the specified <tt>NEW</tt>, it also does not filter based on
* the descriptor passed into <tt>BeforeNew</tt>.
*/
@Deprecated
public MethodInsnNode findInitNodeFor(TypeInsnNode newNode) {
int start = this.indexOf(newNode);
for (Iterator<AbstractInsnNode> iter = this.insns.iterator(start); iter.hasNext();) {
AbstractInsnNode insn = iter.next();
if (insn instanceof MethodInsnNode && insn.getOpcode() == Opcodes.INVOKESPECIAL) {
MethodInsnNode methodNode = (MethodInsnNode)insn;
if (Constants.CTOR.equals(methodNode.name) && methodNode.owner.equals(newNode.desc)) {
return methodNode;
}
}
}
return null;
return this.findInitNodeFor(newNode, null);
}

/**
Expand Down

0 comments on commit 1bae530

Please sign in to comment.