Print opcode name in initialiser error message

This commit is contained in:
Mumfrey committed 2015-02-22 21:35:22 +00:00
1 parent 9d9c2238e8
commit 09448540a6
2 files changed
+3 -2

No files matched your search

@@ -756,7 +756,8 @@ public class MixinTransformer extends TreeTransformer {
if (opcode == ivalidOp) {
// At the moment I don't handle any transient locals because I haven't seen any in the wild, but let's avoid writing
// code which will likely break things and fix it if a real test case ever appears
throw new InvalidMixinException("Cannot handle opcode 0x" + Integer.toHexString(opcode) + " in class initialiser");
throw new InvalidMixinException("Cannot handle " + ASMHelper.getOpcodeName(opcode) +" opcode (0x"
+ Integer.toHexString(opcode).toUpperCase() + ") in class initialiser");
}
}
@@ -406,7 +406,7 @@ public class ASMHelper {
* @return Approximate opcode name (approximate because some constants in
* the {@link Opcodes} class have the same value as opcodes
*/
private static String getOpcodeName(int opcode) {
public static String getOpcodeName(int opcode) {
if (opcode > 0) {
boolean found = false;