summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/create/tests
diff options
context:
space:
mode:
authorRaphael <raphael@google.com>2010-10-22 13:32:04 -0700
committerRaphael <raphael@google.com>2010-10-22 13:33:50 -0700
commitd556d8ba369e05836bedab6004f3dbdc5ec3387e (patch)
tree8fff4f9f0d449ec530bc2d71e36a3786e32e3109 /tools/layoutlib/create/tests
parentcf3c7cf3c986526398e2bc79a39227d751202822 (diff)
downloadframeworks_base-d556d8ba369e05836bedab6004f3dbdc5ec3387e.zip
frameworks_base-d556d8ba369e05836bedab6004f3dbdc5ec3387e.tar.gz
frameworks_base-d556d8ba369e05836bedab6004f3dbdc5ec3387e.tar.bz2
Remove dependency on ASM util classes.
Change-Id: I975b103f8c207e727699e4135170755f6ba2a084
Diffstat (limited to 'tools/layoutlib/create/tests')
-rw-r--r--tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java41
1 files changed, 20 insertions, 21 deletions
diff --git a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java
index 9ad2e6e..7d80796 100644
--- a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java
+++ b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java
@@ -28,11 +28,8 @@ import org.junit.Before;
import org.junit.Test;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
-import org.objectweb.asm.util.TraceClassVisitor;
import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -178,24 +175,26 @@ public class DelegateClassAdapterTest {
};
cl2.testModifiedInstance();
- } catch (Throwable t) {
- // For debugging, dump the bytecode of the class in case of unexpected error.
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- TraceClassVisitor tcv = new TraceClassVisitor(pw);
-
- ClassReader cr2 = new ClassReader(bytes);
- cr2.accept(tcv, 0 /* flags */);
-
- String msg = "\n" + t.getClass().getCanonicalName();
- if (t.getMessage() != null) {
- msg += ": " + t.getMessage();
- }
- msg = msg + "\nBytecode dump:\n" + sw.toString();
-
- // Re-throw exception with new message
- RuntimeException ex = new RuntimeException(msg, t);
- throw ex;
+ // This code block is useful for debugging. However to make it work you need to
+ // pull in the org.objectweb.asm.util.TraceClassVisitor class and associated
+ // utilities which are found in the ASM source jar.
+ //
+ // } catch (Throwable t) {
+ // For debugging, dump the bytecode of the class in case of unexpected error.
+ // StringWriter sw = new StringWriter();
+ // PrintWriter pw = new PrintWriter(sw);
+ // TraceClassVisitor tcv = new TraceClassVisitor(pw);
+ // ClassReader cr2 = new ClassReader(bytes);
+ // cr2.accept(tcv, 0 /* flags */);
+ // String msg = "\n" + t.getClass().getCanonicalName();
+ // if (t.getMessage() != null) {
+ // msg += ": " + t.getMessage();
+ // }
+ // msg = msg + "\nBytecode dump:\n" + sw.toString();
+ // // Re-throw exception with new message
+ // RuntimeException ex = new RuntimeException(msg, t);
+ // throw ex;
+ } finally {
}
}