diff --git a/dex-translator/src/main/java/com/googlecode/d2j/dex/ExDex2Asm.java b/dex-translator/src/main/java/com/googlecode/d2j/dex/ExDex2Asm.java index bd0da422c..2da4e8d69 100644 --- a/dex-translator/src/main/java/com/googlecode/d2j/dex/ExDex2Asm.java +++ b/dex-translator/src/main/java/com/googlecode/d2j/dex/ExDex2Asm.java @@ -48,7 +48,13 @@ public void convertCode(DexMethodNode methodNode, MethodVisitor mv, ClzCtx clzCt } } // code convert ok, copy to MethodWriter and check for Size - mn.accept(mv); + try { + mn.accept(mv); + } catch (Exception e) { + System.out.println("Cannot convert " + clzCtx.classDescriptor); + if (exceptionHandler != null) + exceptionHandler.handleMethodTranslateException(methodNode.method, methodNode, mn, e); + } if (mw != null) { try { AsmBridge.sizeOfMethodWriter(mw); diff --git a/dex-writer/src/main/java/com/googlecode/d2j/dex/writer/ev/EncodedValue.java b/dex-writer/src/main/java/com/googlecode/d2j/dex/writer/ev/EncodedValue.java index b655fc386..307be486c 100644 --- a/dex-writer/src/main/java/com/googlecode/d2j/dex/writer/ev/EncodedValue.java +++ b/dex-writer/src/main/java/com/googlecode/d2j/dex/writer/ev/EncodedValue.java @@ -415,7 +415,7 @@ public int compareTo(EncodedValue o) { case VALUE_METHOD_HANDLE: case VALUE_METHOD_TYPE: if (value instanceof Comparable) { - return ((Comparable) value).compareTo(value); + return ((Comparable) value).compareTo(o.value); } else { throw new RuntimeException(); }