diff options
| author | 2014-04-08 22:47:44 +0000 | |
|---|---|---|
| committer | 2014-04-08 22:47:45 +0000 | |
| commit | 6e5e160f19c404c272e70f7f0ade5b27850ebd05 (patch) | |
| tree | 07ce55e46657506b8fbc5b0896998e44cb79af8c | |
| parent | 18c7f559a02d3c1a250ecb0aebcd76d5291110b9 (diff) | |
| parent | 6a08225cee197e5baf80dd06dae46988db284122 (diff) | |
Merge "Make layoutlib load on Java 7 VM"
| -rw-r--r-- | tools/layoutlib/create/.classpath | 2 | ||||
| -rw-r--r-- | tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/tools/layoutlib/create/.classpath b/tools/layoutlib/create/.classpath index cd8bb0d7d3fb..25c3b3ed1a9b 100644 --- a/tools/layoutlib/create/.classpath +++ b/tools/layoutlib/create/.classpath @@ -4,6 +4,6 @@ <classpathentry excluding="mock_data/" kind="src" path="tests"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-4.0.jar" sourcepath="/ANDROID_PLAT/prebuilts/tools/common/asm-tools/src-4.0.zip"/> + <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilts/misc/common/asm/asm-4.0.jar" sourcepath="/ANDROID_PLAT_SRC/prebuilts/misc/common/asm/src.zip"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java index b2caa25b9c29..323a7914ad62 100644 --- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java +++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java @@ -177,6 +177,17 @@ public abstract class AbstractClassAdapter extends ClassVisitor { } } + /* Java 7 verifies the StackMapTable of a class if its version number is greater than 50.0. + * However, the check is disabled if the class version number is 50.0 or less. Generation + * of the StackMapTable requires a rewrite using the tree API of ASM. As a workaround, + * we rewrite the version number of the class to be 50.0 + * + * http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6693236 + */ + if (version > 50) { + version = 50; + } + super.visit(version, access, name, signature, superName, interfaces); } |