MCPcopy Create free account
hub / github.com/GraxCode/zelixkiller / copy

Method copy

src/me/nov/zelixkiller/utils/MethodUtils.java:30–39  ·  view source on GitHub ↗

copy InsnList start included, end excluded @param list @param start @param end @return

(InsnList list, AbstractInsnNode start, AbstractInsnNode end)

Source from the content-addressed store, hash-verified

28 * @return
29 */
30 public static InsnList copy(InsnList list, AbstractInsnNode start, AbstractInsnNode end) {
31 InsnList newList = new InsnList();
32 Map<LabelNode, LabelNode> labelMap = getLabelMap(list);
33 AbstractInsnNode ain = start == null ? list.getFirst() : start;
34 while (ain != null && ain != end) {
35 newList.add(ain.clone(labelMap));
36 ain = ain.getNext();
37 }
38 return newList;
39 }
40
41 public static MethodNode cloneInstructions(MethodNode method, String newName) {
42 MethodNode mn = new MethodNode(method.access, newName != null ? newName : method.name, method.desc,

Callers 7

cloneInstructionsMethod · 0.95
transformMethod · 0.95
createProxyMethod · 0.95
cutClinitMethod · 0.95
analyzeMethod · 0.80
findSubroutineMethod · 0.80
mergeMethod · 0.80

Calls 2

getLabelMapMethod · 0.95
cloneMethod · 0.80

Tested by

no test coverage detected