Skip to content

Commit 9547c78

Browse files
committed
Update ASM to 5.0.2
1 parent 25f5c79 commit 9547c78

7 files changed

Lines changed: 21 additions & 21 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ artifacts {
3535
}
3636

3737
dependencies {
38-
compile 'org.ow2.asm:asm-debug-all:4.1'
38+
compile 'org.ow2.asm:asm-debug-all:5.0.4'
3939
compile 'net.sf.jopt-simple:jopt-simple:4.5'
4040
compile 'com.google.code.gson:gson:2.2.4'
4141
}

src/main/java/de/oceanlabs/mcp/mcinjector/adaptors/AccessReader.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class AccessReader extends ClassVisitor
2323

2424
public AccessReader(ClassVisitor cv, MCInjectorImpl mci)
2525
{
26-
super(ASM4, cv);
26+
super(ASM5, cv);
2727
//this.mci = mci;
2828
}
2929

@@ -44,7 +44,7 @@ public MethodVisitor visitMethod(int access, String name, String desc, String si
4444
final AccessInfo info = new AccessInfo(className, name, desc);
4545
info.access = access;
4646
methods.put(path, info);
47-
47+
4848
ret = new MethodVisitor(api, ret)
4949
{
5050
// GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
@@ -56,10 +56,10 @@ public void visitFieldInsn(int opcode, String owner, String name, String desc)
5656
}
5757

5858
// INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.
59-
public void visitMethodInsn(int opcode, String owner, String name, String desc)
59+
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf)
6060
{
6161
info.add(opcode, owner, name, desc);
62-
super.visitMethodInsn(opcode, owner, name, desc);
62+
super.visitMethodInsn(opcode, owner, name, desc, itf);
6363
}
6464
};
6565
}
@@ -84,7 +84,7 @@ private static class AccessInfo
8484
public String desc;
8585
public int access;
8686
public List<Insn> insns = new ArrayList<Insn>();
87-
87+
8888
public static class Insn
8989
{
9090
public int opcode;
@@ -117,7 +117,7 @@ public String toString()
117117
return op + " " + target_owner + "/" + target_name + " " + target_desc;
118118
}
119119
}
120-
120+
121121
public AccessInfo(String owner, String name, String desc)
122122
{
123123
this.owner = owner;
@@ -140,7 +140,7 @@ public String toString()
140140
buf.append(']');
141141
return buf.toString();
142142
}
143-
143+
144144
public boolean targetEquals(AccessInfo o)
145145
{
146146
return toString().equals(o.toString());

src/main/java/de/oceanlabs/mcp/mcinjector/adaptors/ApplyMap.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class ApplyMap extends ClassVisitor
2828

2929
public ApplyMap(ClassNode cn, MCInjectorImpl mci)
3030
{
31-
super(Opcodes.ASM4, cn);
31+
super(Opcodes.ASM5, cn);
3232
this.mci = mci;
3333
this.cn = cn;
3434
}
@@ -49,11 +49,11 @@ public MethodVisitor visitMethod(int access, String name, String desc, String si
4949
{
5050
return super.visitMethod(access, name, desc, signature, exceptions);
5151
}
52-
52+
5353
if (!mci.generate) log.log(Level.FINER, " Name: " + name + " Desc: " + desc + " Sig: " + signature);
5454

5555
String clsSig = this.className + "." + name + desc;
56-
56+
5757
exceptions = processExceptions(clsSig, exceptions);
5858

5959
// abstract and native methods don't have a Code attribute
@@ -111,34 +111,34 @@ private MethodNode processLVT(String clsName, String classSig, MethodNode mn)
111111
}
112112

113113
types.addAll(Arrays.asList(Type.getArgumentTypes(mn.desc)));
114-
114+
115115
//Skip anything with no params
116116
if (types.size() == 0)
117117
{
118118
return mn;
119119
}
120-
120+
121121
log.fine(" Applying map:");
122122
if (params.size() != types.size())
123123
{
124124
log.log(Level.SEVERE, " Incorrect argument count: " + types.size() + " -> " + params.size());
125125
throw new RuntimeException("Incorrect argument count: " + types.size() + " -> " + params.size());
126126
}
127-
128-
127+
128+
129129
// Add labels to the start and end if they are not already labels
130130
AbstractInsnNode tmp = mn.instructions.getFirst();
131131
if (tmp == null)
132132
mn.instructions.add(new LabelNode());
133133
else if (tmp.getType() != AbstractInsnNode.LABEL)
134134
mn.instructions.insertBefore(tmp, new LabelNode());
135-
135+
136136
tmp = mn.instructions.getLast();
137137
if (tmp == null)
138138
mn.instructions.add(new LabelNode());
139139
else if (tmp.getType() != AbstractInsnNode.LABEL)
140140
mn.instructions.insert(tmp, new LabelNode());
141-
141+
142142
//Grab the start and end labels
143143
LabelNode start = (LabelNode)mn.instructions.getFirst();
144144
LabelNode end = (LabelNode)mn.instructions.getLast();

src/main/java/de/oceanlabs/mcp/mcinjector/adaptors/ApplyMarker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class ApplyMarker extends ClassVisitor
1818

1919
public ApplyMarker(ClassVisitor cv, MCInjectorImpl mci)
2020
{
21-
super(Opcodes.ASM4, cv);
21+
super(Opcodes.ASM5, cv);
2222
this.mci = mci;
2323
}
2424

src/main/java/de/oceanlabs/mcp/mcinjector/adaptors/GenerateMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class GenerateMap extends ClassVisitor
2222

2323
public GenerateMap(ClassVisitor cv, MCInjectorImpl mci)
2424
{
25-
super(Opcodes.ASM4, cv);
25+
super(Opcodes.ASM5, cv);
2626
this.mci = mci;
2727
}
2828

src/main/java/de/oceanlabs/mcp/mcinjector/adaptors/JsonAttribute.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class JsonAttribute extends ClassVisitor
2626

2727
public JsonAttribute(ClassVisitor cv, MCInjectorImpl mci)
2828
{
29-
super(Opcodes.ASM4, cv);
29+
super(Opcodes.ASM5, cv);
3030
this.mci = mci;
3131
}
3232

src/main/java/de/oceanlabs/mcp/mcinjector/adaptors/ReadMarker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class ReadMarker extends ClassVisitor
1515

1616
public ReadMarker(ClassVisitor cv, MCInjectorImpl mci)
1717
{
18-
super(Opcodes.ASM4, cv);
18+
super(Opcodes.ASM5, cv);
1919
}
2020

2121
@Override

0 commit comments

Comments
 (0)