Bug 390930 - [1.8] Update to ASM 5.x
Summary: [1.8] Update to ASM 5.x
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks: 410447 427495 427496 427502 429062
  Show dependency tree
 
Reported: 2012-10-02 10:03 EDT by Krzysztof Daniel CLA
Modified: 2014-04-30 07:28 EDT (History)
10 users (show)

See Also:
daniel_megert: pmc_approved+


Attachments
bundle (844.89 KB, application/x-zip-compressed)
2012-10-02 16:48 EDT, Michael Rennie CLA
no flags Details
ASM 5.0-BETA (869.82 KB, application/zip)
2014-01-21 10:14 EST, Michael Rennie CLA
no flags Details
adapt to new APIs (15.34 KB, patch)
2014-02-19 20:59 EST, Michael Rennie CLA
no flags Details | Diff
update (17.34 KB, patch)
2014-02-19 23:15 EST, Michael Rennie CLA
no flags Details | Diff
patch for Luna (17.29 KB, application/octet-stream)
2014-02-24 14:51 EST, Michael Rennie CLA
no flags Details
BETA_JAVA8 update (28.35 KB, patch)
2014-02-26 12:46 EST, Michael Rennie CLA
no flags Details | Diff
Update BETA_JAVA8 (20.49 KB, patch)
2014-02-26 15:51 EST, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Daniel CLA 2012-10-02 10:03:57 EDT
It's a good practice to stay up to date with new libraries.
Comment 1 Michael Rennie CLA 2012-10-02 14:20:08 EDT
Here is the ASM webpage: http://forge.ow2.org/projects/asm/

Here is the diff page from 3.3 to 4.0: http://asm.ow2.org/jdiff33to40/changes.html
Comment 2 Olivier Thomann CLA 2012-10-02 14:42:27 EDT
The corresponding CQ is already done and approved.
https://dev.eclipse.org/ipzilla/show_bug.cgi?id=6591
Comment 3 Michael Rennie CLA 2012-10-02 16:48:42 EDT
Created attachment 221810 [details]
bundle

Here is the ASM 4.0 bundle for testing, it is complete with source, etc and can be checked in to Orbit.
Comment 4 Michael Rennie CLA 2012-10-02 17:00:49 EDT
I started the code changes to adopt the new version of ASM. There are many API changes and API tools will require (at a minimum) ASM 4.x moving forward.

There are still many test failures and I have to figure out how to collect the default value for an Annotation in our TypeStructureBuilder (using the new API).

The branch is here: http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?h=mrennie/bug390930
Comment 5 Curtis Windatt CLA 2013-03-18 16:38:49 EDT
Removing the 4.3 milestone.  We don't have the resources to sort out the remaining issues with upgrading.  It is also late in the release for making changes such as this.
Comment 6 Michael Rennie CLA 2014-01-21 09:01:17 EST
For Java 8 support we need a 5.x version of ASM, changing this report to refer to ASM 5.x instead of 4.x.
Comment 7 Michael Rennie CLA 2014-01-21 10:14:43 EST
Created attachment 239190 [details]
ASM 5.0-BETA

Here is the 5.0-beta version of ASM that should support Java 8. I have not checked out the branch yet to determine if there are additional API changes from 4.x -> 5.x.
Comment 8 Michael Rennie CLA 2014-02-19 20:59:06 EST
Created attachment 240128 [details]
adapt to new APIs

This patch adapts API tools to use ASM 5.0. There are a few wrinkles:

1. there are a few test failures to be sorted out
2. reference extraction for default methods does not seem to resolve them correctly

This patch sorts out the Annotation default problem I encountered from before, and allows reference extraction, type structure building and binary compare to work.
Comment 9 Michael Rennie CLA 2014-02-19 23:15:45 EST
Created attachment 240129 [details]
update

With this patch all the new APIs are used and all tests pass.
Comment 10 Michael Rennie CLA 2014-02-21 10:34:26 EST
The Orbit CQ for ASM 5.0 is: http://dev.eclipse.org/ipzilla/show_bug.cgi?id=7941
Comment 11 Dani Megert CLA 2014-02-21 10:36:30 EST
And for PDE we have  http://dev.eclipse.org/ipzilla/show_bug.cgi?id=7942
Comment 12 Michael Rennie CLA 2014-02-24 14:51:42 EST
Created attachment 240275 [details]
patch for Luna

Here is the patch ported for Luna (4.4). All tests pass there as well.
Comment 13 Michael Rennie CLA 2014-02-26 12:46:12 EST
Created attachment 240338 [details]
BETA_JAVA8 update

Here is a further update for the generator and profile modifiers that will be needed to properly generate the fragment in bug 429062
Comment 14 Michael Rennie CLA 2014-02-26 15:51:43 EST
Created attachment 240346 [details]
Update BETA_JAVA8

This update is because there were overlapping changes needed in bug 429062
Comment 15 Michael Rennie CLA 2014-03-11 11:49:12 EDT
ASM 5 has been added to Orbit, now we need to apply the patches and run some test builds
Comment 16 Michael Rennie CLA 2014-03-12 00:06:45 EDT
(In reply to Michael Rennie from comment #15)
> ASM 5 has been added to Orbit, now we need to apply the patches and run some
> test builds

We have a successful orbit I-build with ASM 5.0; http://build.eclipse.org/orbit/committers/orbit-I/20140311210553/I20140311210553/
Comment 17 Curtis Windatt CLA 2014-03-13 12:59:20 EDT
http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?h=BETA_JAVA8_LUNA&id=abb117132844c0b2dc8007cd51dfe327059ca61a
ASM upgrade applied to BETA_JAVA8_LUNA.  Updated the patch to use version ranges and to not mark Java 8 bytecodes as unsupported.  For now I just commented out the Java 8 check, but we may want to remove the preference entirely (Bug 430305).
Comment 18 Michael Rennie CLA 2014-03-19 15:19:48 EDT
(In reply to Curtis Windatt from comment #17)
> http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/
> ?h=BETA_JAVA8_LUNA&id=abb117132844c0b2dc8007cd51dfe327059ca61a
> ASM upgrade applied to BETA_JAVA8_LUNA.  Updated the patch to use version
> ranges and to not mark Java 8 bytecodes as unsupported.  For now I just
> commented out the Java 8 check, but we may want to remove the preference
> entirely (Bug 430305).

I updated the libs for the official release in my workspace and it is a complete failure. Almost all of the unit tests fail once the following exception is reported:

java.lang.ClassFormatError: Duplicate field name&signature in class file org/objectweb/asm/tree/MethodNode
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:272)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:588)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:540)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:527)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:330)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:311)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:379)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at org.eclipse.pde.api.tools.internal.model.TypeStructureBuilder.buildTypeStructure(TypeStructureBuilder.java:282)
	at org.eclipse.pde.api.tools.internal.model.AbstractApiTypeRoot.getStructure(AbstractApiTypeRoot.java:60)
	at org.eclipse.pde.api.tools.internal.provisional.scanner.TagScanner$Visitor.resolveMethod(TagScanner.java:621)
	at org.eclipse.pde.api.tools.internal.provisional.scanner.TagScanner$Visitor.scanMethodJavaDoc(TagScanner.java:508)
	at org.eclipse.pde.api.tools.internal.provisional.scanner.TagScanner$Visitor.visit(TagScanner.java:487)
	at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:611)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)
	at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:470)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)
	at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:212)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
	at org.eclipse.pde.api.tools.internal.provisional.scanner.TagScanner.scan(TagScanner.java:742)
	at org.eclipse.pde.api.tools.internal.provisional.scanner.TagScanner.scan(TagScanner.java:688)
	at org.eclipse.pde.api.tools.internal.ProjectApiDescription$TypeNode.refresh(ProjectApiDescription.java:268)
	at org.eclipse.pde.api.tools.internal.ApiDescription.findNode(ApiDescription.java:463)
	at org.eclipse.pde.api.tools.internal.ProjectApiDescription.visit(ProjectApiDescription.java:436)
	at org.eclipse.pde.api.tools.internal.ProjectApiDescription.accept(ProjectApiDescription.java:405)
	at org.eclipse.pde.api.tools.builder.tests.ApiBuilderTest.exportApiComponent(ApiBuilderTest.java:351)
	at org.eclipse.pde.api.tools.builder.tests.compatibility.CompatibilityTest.setUp(CompatibilityTest.java:177)
	at junit.framework.TestCase.runBare(TestCase.java:139)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness$1.run(PlatformUITestHarness.java:47)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3978)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1119)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1003)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:147)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:630)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:574)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:125)
	at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runApp(NonUIThreadTestApplication.java:54)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication.runApp(UITestApplication.java:47)
	at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.start(NonUIThreadTestApplication.java:48)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:133)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:103)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:378)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:232)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1462)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

I opened MethodNode using javap and sure enough, there are colliding fields:

static java.lang.Class class$org$objectweb$asm$tree$MethodNode;
    descriptor: Ljava/lang/Class;
    flags: ACC_STATIC
    Synthetic: true

static java.lang.Class class$org$objectweb$asm$tree$MethodNode;
  descriptor: Ljava/lang/Class;
  flags: ACC_STATIC
  Synthetic: true
Comment 19 Michael Rennie CLA 2014-03-19 15:22:50 EDT
Someone beat me to it - the ASM bug is:

http://forge.ow2.org/tracker/index.php?func=detail&aid=317123&group_id=23&atid=100023
Comment 20 Marc R. Hoffmann CLA 2014-03-19 16:37:31 EDT
FYI: I'm the one who opened the ASM bug just yesterday. But in the meantime I figured out that asm-debug-all works fine (and beside it's sightly bigger provides proper debug information most other libraries do nowadays). So we released JaCoCo based on asm-debug-all.
Comment 21 Michael Rennie CLA 2014-03-20 11:48:46 EDT
(In reply to Marc R. Hoffmann from comment #20)
> FYI: I'm the one who opened the ASM bug just yesterday. But in the meantime
> I figured out that asm-debug-all works fine (and beside it's sightly bigger
> provides proper debug information most other libraries do nowadays). So we
> released JaCoCo based on asm-debug-all.

Thanks for the info Marc, but we will have to wait for the 'fixed' jars due to the way we provide ASM via Orbit.
Comment 22 Curtis Windatt CLA 2014-03-24 16:42:41 EDT
The 5.0.1 service release is working correctly.
Comment 23 Michael Rennie CLA 2014-03-24 21:15:38 EDT
I created the new CQs for the new version:

PDE CQ: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=8129
Orbit CQ: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=8128
Comment 24 Michael Rennie CLA 2014-03-26 07:12:29 EDT
(In reply to Michael Rennie from comment #23)
> I created the new CQs for the new version:
> 
> PDE CQ: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=8129
> Orbit CQ: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=8128

ASM 5.0.1 has been approved and added to Orbit. Once we have a build to consume there is a bit of work to do:

1. rev the in bundle versions to require 5.0.1
2. consume the new API method visitMethodInsn in our method visitors
Comment 25 David Williams CLA 2014-03-26 10:16:50 EDT
Any careful coordination needed here? Or should I just "slam" 5.0.1 in our build when it's ready?
Comment 26 Michael Rennie CLA 2014-03-26 10:19:54 EDT
(In reply to David Williams from comment #25)
> Any careful coordination needed here? Or should I just "slam" 5.0.1 in our
> build when it's ready?

Just add it when ready.
Comment 27 Michael Rennie CLA 2014-03-26 12:50:30 EDT
(In reply to Michael Rennie from comment #24)

> ASM 5.0.1 has been approved and added to Orbit. Once we have a build to
> consume there is a bit of work to do:
> 
> 1. rev the in bundle versions to require 5.0.1
> 2. consume the new API method visitMethodInsn in our method visitors

3. implement the visitInvokeDynamicInsn method
Comment 28 David Williams CLA 2014-03-29 14:30:07 EDT
FWIW, I've updated our "orbit prereqs" with the latest version from Orbit: 

<unit id="org.objectweb.asm" version="5.0.1.v201403281216"/>
<unit id="org.objectweb.asm.source" version="5.0.1.v201403281216"/>

Orbit build 

http://download.eclipse.org/tools/orbit/downloads/drops/I20140328134327/

And, now that I've committed it, 

http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/commit/?id=55cf3c60968274ecbf6e3d5df566497923856ec3

I remembered that the PDE feature that includes it may have to be "touched". 

Well, we'll see if I cause Sat. afternoon build failure ... if I do ... I can back out until we're ready to "coordinate".
Comment 29 David Williams CLA 2014-03-29 14:33:11 EDT
> I remembered that the PDE feature that includes it may have to be "touched". 
> 
> Well, we'll see if I cause Sat. afternoon build failure ... if I do ... I
> can back out until we're ready to "coordinate".

Oh, and now I just remembered we should be fine for an N-build ... but the feature will have to be "touch" before next I-build.
Comment 30 Michael Rennie CLA 2014-03-31 09:51:15 EDT
(In reply to David Williams from comment #29)
> > I remembered that the PDE feature that includes it may have to be "touched". 
> > 
> > Well, we'll see if I cause Sat. afternoon build failure ... if I do ... I
> > can back out until we're ready to "coordinate".
> 
> Oh, and now I just remembered we should be fine for an N-build ... but the
> feature will have to be "touch" before next I-build.

I pushed the fix to use the new visitMethodInsn + new versions: 

http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=570f6a45d49541588115c0ae86558e1290299e91

I touched the feature: 

http://git.eclipse.org/c/pde/eclipse.pde.git/commit/?id=e49a188db4eb96d49f35832640044e93a79924bd
Comment 31 Vikas Chandra CLA 2014-04-30 07:28:27 EDT
Verified for Eclipse(4.4) Luna M7 using build eclipse-SDK-I20140429-2000-win32-x86_64


ASM version is 5.0.1 25th april timestamp 1740