This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 416773 - Legacy mode not backward compatible
Summary: Legacy mode not backward compatible
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.4 M2   Edit
Assignee: Wojciech Sudol CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 417093
  Show dependency tree
 
Reported: 2013-09-07 03:15 EDT by Marco Maccaferri CLA
Modified: 2013-09-17 08:03 EDT (History)
2 users (show)

See Also:


Attachments
Sample RCP application (148.95 KB, application/zip)
2013-09-09 10:10 EDT, Marco Maccaferri CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Maccaferri CLA 2013-09-07 03:15:03 EDT
In an attempt to port an RCP application written for Eclipse 3.8 to 4.3 using the legacy compatibility mode, I was initially using the Eclipse 4.2 target platform to also temporarily circumvent bug #416746, when I changed the target platform to Eclipse 4.3 I found that it is not backward compatible, not only it throws exceptions but also freezes without displaying any UI or information to the user.

This is unacceptable, future releases must be backward compatibile, I can't write an application then tell my users to wipe the workspace files because the platform update is not compatible. This is a showstopper for me!

These are the exceptions thrown when launching the application using 4.3 target platform and workspace files created with 4.2 target platform.

!SESSION 2013-09-07 09:04:22.274 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_38
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=it_IT
Framework arguments:  -product com.maccasoft.platform.workbench
Command-line arguments:  -product com.maccasoft.platform.workbench -data /home/marco/e4/../runtime-workspace -dev file:/home/marco/e4/.metadata/.plugins/org.eclipse.pde.core/Program/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog

!ENTRY org.eclipse.e4.ui.workbench.swt 4 2 2013-09-07 09:04:27.691
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.e4.ui.workbench.swt".
!STACK 0
java.util.ConcurrentModificationException
	at org.eclipse.emf.common.util.AbstractEList$EIterator.checkModCount(AbstractEList.java:756)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:704)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:696)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1042)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at com.maccasoft.ui.internal.application.Application.start(Application.java:55)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-09-07 09:04:27.696
!MESSAGE Exception occurred while rendering: org.eclipse.e4.ui.model.application.ui.basic.impl.TrimmedWindowImpl@3f508f31 (elementId: IDEWindow, tags: [topLevel], contributorURI: platform:/plugin/com.maccasoft.platform) (widget: Shell {MaccaSoft - Default}, renderer: org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer@1167acf2, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: null, iconURI: null, tooltip: null, context: TrimmedWindowImpl (IDEWindow) Context, variables: [], x: 0, y: 0, width: 1028, height: 766)
!STACK 0
java.util.ConcurrentModificationException
	at org.eclipse.emf.common.util.AbstractEList$EIterator.checkModCount(AbstractEList.java:756)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:704)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:696)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1042)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at com.maccasoft.ui.internal.application.Application.start(Application.java:55)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Comment 1 Paul Webster CLA 2013-09-09 09:37:53 EDT
I'm not able to reproduce that.  Please attach a sample plugin that causes the failure you see.

PW
Comment 2 Marco Maccaferri CLA 2013-09-09 10:10:17 EDT
Created attachment 235305 [details]
Sample RCP application

This is the sample application I'm working on, it does nothing more than open a workbench window (I'm using it as a start template for RCP applications). It includes a Program.launch file.

First start it using a 4.2 plugin dev. target platform, then close and change the target platform to 4.3 and start again using the same workspace, you should see the exceptions and the application freeze without even display the UI.
Comment 3 Paul Webster CLA 2013-09-09 10:12:52 EDT
Thank you for including the sample.

If it's a problem, it should show the problem when starting with 4.3 (4.2 will not have anything to do with it).

PW
Comment 4 Marco Maccaferri CLA 2013-09-09 10:22:41 EDT
Well, the problem is that with 4.3 the application looses the toolbar after the first run (see bug #416746) so it is useless. I tought to start porting using 4.2 and then update to 4.3 when the bug is fixed but this compatibility issue is a showstopper because I can't install 4.2-based applications and then loose everything because the workspace files can't be readed by the new platform.
Comment 5 Paul Webster CLA 2013-09-09 10:52:31 EDT
So this usecase:

1) run in 4.2.x and create a workspace.  
2) run in 4.3.x and create a workspace.
3) re-launch 4.3.x version pointing at the 4.2.x created workspace
Expected result:  It comes up.

PW
Comment 6 Marco Maccaferri CLA 2013-09-09 11:13:52 EDT
Exactly.
Comment 7 Wojciech Sudol CLA 2013-09-10 08:05:43 EDT
Marco,
What is the exact version of eclipse 4.2 you use?
I cannot reproduce the bug. Moreover your application behaves differently when I run it in 4.2.0 and 4.2.2.
In 4.2.0 it crashes when I run it for the first time (java.lang.ArithmeticException: divide by zero) but later it works fine, but in 4.2.2 the toolbar is not visible at all.
Comment 8 Marco Maccaferri CLA 2013-09-10 09:37:01 EDT
Ah, I was using 4.2.0 I forgot to update the target platform, however I don't get the exception error. Using 4.2.2 the toolbar disappears after the first launch, but there aren't exceptions when switching the target platform to 4.3.0.
Comment 9 Wojciech Sudol CLA 2013-09-10 10:26:24 EDT
So it looks like we can close this bug, right?
Comment 10 Marco Maccaferri CLA 2013-09-10 11:11:41 EDT
The error occurs also when upgrade from 4.2.0 to 4.2.2, I think that the compatibility should be fixed anyway. I guess that it depends on how many projects are currently using 4.2.0 and skipped the updates (since the toolbar bug seems to be present for a long time), the day they update to 4.3.x they will hit this bug.
Comment 11 Wojciech Sudol CLA 2013-09-10 11:50:09 EDT
OK, I will investigate it deeper.
How do you change the target platform? Do you switch the target platform in Eclipse preferences or do you run two independent Eclipse instances (4.2 and 4.3)?
Comment 12 Marco Maccaferri CLA 2013-09-10 12:07:21 EDT
I change it in the Eclipse preferences.
Comment 13 Wojciech Sudol CLA 2013-09-12 08:53:47 EDT
The problem is that the workbench.xmi file created by eclipse 4.2.0 does not contain entries for vertical trim bars (left and right), so their related TrimBarImpl instances are not created when parsing the file.
Later, when WBWRenderer renders a window, it iterates through two TrimBarImpl instances (top and bottom - that are present in the workbench.xmi). 
During building UI element for status line (that is a part of bottom trim bar) ,the  Workbench.createWorkbenchWindow(...) method is invoked, which in turn creates missing TrimBarImpl instances for left and right trim bars.
The two new instances of TrimBarImpl are added to the same list that WBWRenderer is iterating through (TrimmedWindowImpl.trimBars), what throws the ConcurrentModificationException.
The solution seems to be trivial: iterate through a copy of the TrimBarImpl list.

Review URL: https://git.eclipse.org/r/#/c/16362/
Comment 15 Wojciech Sudol CLA 2013-09-17 08:03:08 EDT
Verified in the build: I20130916-2330