archimatetool / archi

Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
MIT License
914 stars 267 forks source link

⚠️ Eclipse versioning issues #1036

Open Phillipus opened 3 months ago

Phillipus commented 3 months ago

This issue is to track problems with using different versions of Eclipse.

Background

So the problem is what are pros and cons of each new Eclipse version?

Phillipus commented 3 months ago

The following is a list of Eclipse updates and what is fixed and what is broken for Archi. These Eclipse builds contain other fixes and improvements, but I've just listed the ones that affect Archi most obviously.

Eclipse 4.29 (September 2023)

No notable fixes or new features in this version that I'm aware of so no point in using this version.

Eclipse 4.30 (December 2023)

✅ Fixes line dash spacing bug on Windows at 200% scale ❌ Tree text is clipped on Mac Intel

Eclipse 4.31 (March 2024)

✅ (Fixes from previous versions) ✅ Fixes flipped splash screen image on Mac ❌ Table/Tree/List row heights are bigger on Mac with no option for smaller heights

Eclipse 4.32 (June 2024 not yet released)

✅ (Fixes from previous versions) ✅ Option to use small or large row heights on Mac ✅ Fixes potential showstopper on Mac ❓ Regressions/bugs possible but not known yet

Phillipus commented 3 months ago

I had intended to use Eclipse 4.31 for Archi 5.3 (and had even created an early access build with it) but because of the Table/Tree/List row heights are bigger on Mac with no option for smaller heights problem reverted back to Eclipse 4.28. Let's pray that Eclipse 4.32 in June is the one.

Note that it's mainly problems in Mac that stop us moving forward to the latest version of Eclipse.

Side note - it's becoming increasingly difficult to work with Eclipse with its daily regressions, breaking changes and arbitrary change for the sake of change. Every day brings a new headache.

Phillipus commented 2 months ago

Possible danger here - https://github.com/eclipse-platform/eclipse.platform.swt/pull/1064

noxxious commented 1 month ago

Another one, I just spent couple of days figuring out (Linux):

noxxious commented 1 month ago

I've verified the fix by rebuilding Archi with latest night Eclipse and latest GEF (reverted Archi's changes to GEF, Zest and Draw2d)

Phillipus commented 1 month ago

With the GEF version on Archi right now that fails the basic loading of cursors SharedCursors.java, which breaks all tools in Archi as the createCursor does not allow creating with the mask set to null. The latest GEF avoids this by using png files.

Archi doesn't use the GEF SharedCursors we are using PNG images in customised cursors:

https://github.com/archimatetool/archi/blob/master/com.archimatetool.editor/src/com/archimatetool/editor/diagram/tools/ExtCombinedTemplateCreationEntry.java

https://github.com/archimatetool/archi/blob/master/com.archimatetool.editor/src/com/archimatetool/editor/diagram/tools/ExtConnectionCreationToolEntry.java

Phillipus commented 1 month ago

@noxxious OK, perhaps even if Archi is not using the shared cursors perhaps it is failing to load them. I'll replace Archi's SharedCursors code with the latest from GEF.

noxxious commented 1 month ago

It's due to SharedCursors static resources being loaded upon init (clicking in the toolbox) of any Archi's tools. Here's the stacktrace and I've added some logging as I thought initially this was due to scaling on Wayland. For the mask file (bmp) the getImageData() returns null due to missing loader and SWT exception being thrown in the method itself.

!MESSAGE source org.eclipse.swt.graphics.ImageData@15c1b543 null 100

!ENTRY org.eclipse.gef 4 0 2024-05-18 20:17:50.626
!MESSAGE invalid icons/plugmask.gif icons/plug.bmp FileImageDescriptor(location=class org.eclipse.gef.internal.Internal, name=icons/plugmask.gif) FileImageDescriptor(location=class org.eclipse.gef.internal.Internal, name=icons/plug.bmp) org.eclipse.swt.widgets.Display@7aac8884

!ENTRY org.eclipse.gef 4 0 2024-05-18 20:17:50.627
!MESSAGE os 100 false true false

!ENTRY org.eclipse.gef 4 0 2024-05-18 20:17:50.628
!MESSAGE os 100 false true false

!ENTRY org.eclipse.gef 4 0 2024-05-18 20:17:50.629
!MESSAGE os 100 false true false

!ENTRY org.eclipse.gef 4 0 2024-05-18 20:17:50.630
!MESSAGE os 100 false true false

!ENTRY org.eclipse.ui 4 0 2024-05-18 20:17:50.631
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.ExceptionInInitializerError
    at org.eclipse.gef.tools.AbstractConnectionCreationTool.<init>(AbstractConnectionCreationTool.java:75)
    at org.eclipse.gef.tools.ConnectionCreationTool.<init>(ConnectionCreationTool.java:42)
    at com.archimatetool.editor.diagram.tools.MagicConnectionCreationTool.<init>(MagicConnectionCreationTool.java:83)
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
    at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:132)
    at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:259)
    at java.base/java.lang.Class.newInstance(Class.java:755)
    at org.eclipse.gef.palette.ToolEntry.createTool(ToolEntry.java:87)
    at org.eclipse.gef.EditDomain.handlePaletteToolChanged(EditDomain.java:154)
    at org.eclipse.gef.EditDomain$1.activeToolChanged(EditDomain.java:54)
    at org.eclipse.gef.ui.palette.PaletteViewer.fireModeChanged(PaletteViewer.java:181)
    at org.eclipse.gef.ui.palette.PaletteViewer.setActiveTool(PaletteViewer.java:416)
    at org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart$2.actionPerformed(ToolEntryEditPart.java:418)
    at org.eclipse.draw2d.Clickable.fireActionPerformed(Clickable.java:209)
    at org.eclipse.draw2d.Clickable$1.actionPerformed(Clickable.java:177)
    at org.eclipse.draw2d.ButtonModel.fireActionPerformed(ButtonModel.java:141)
    at org.eclipse.draw2d.ToggleModel.fireActionPerformed(ToggleModel.java:28)
    at org.eclipse.draw2d.ButtonModel$DefaultFiringBehavior.released(ButtonModel.java:508)
    at org.eclipse.draw2d.ButtonModel.fireReleased(ButtonModel.java:180)
    at org.eclipse.draw2d.ButtonModel.setPressed(ButtonModel.java:467)
    at org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart$GTKToggleButtonTracker.handleButtonUp(ToolEntryEditPart.java:148)
    at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1215)
    at org.eclipse.gef.tools.SelectionTool.mouseUp(SelectionTool.java:602)
    at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:303)
    at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:408)
    at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:586)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:237)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5855)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1617)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5065)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4517)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
    at com.archimatetool.editor.Application.start(Application.java:70)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1454)
Caused by: java.lang.IllegalArgumentException: Argument cannot be null
    at org.eclipse.swt.SWT.error(SWT.java:4903)
    at org.eclipse.swt.SWT.error(SWT.java:4837)
    at org.eclipse.swt.SWT.error(SWT.java:4808)
    at org.eclipse.swt.graphics.Cursor.<init>(Cursor.java:192)
    at org.eclipse.gef.SharedCursors.createCursor(SharedCursors.java:68)
    at org.eclipse.gef.SharedCursors.<clinit>(SharedCursors.java:50)
    ... 53 more
noxxious commented 1 month ago

I could test right away, but how big and invasive are GEF changes in Archi ?

Phillipus commented 1 month ago

I could test right away, but how big and invasive are GEF changes in Archi ?

I've pushed a fix - https://github.com/archimatetool/archi/commit/8c6906fa5aabfd67979858f42500c8ee487aff6b

noxxious commented 1 month ago

It, works thanks. The loading of splash screen is broken due to it being an XPM, but that is not a big deal. Anyway, if you need help with upgrades to Eclipse I would like to contribute.

Phillipus commented 1 month ago

The loading of splash screen is broken due to it being an XPM, but that is not a big deal.

The splash screen is a BMP. But I just pushed a new commit to change it to PNG.

The app icon is XPM - https://github.com/archimatetool/archi/blob/master/com.archimatetool.editor.product/icons/icon.xpm - and this is the format that Eclipse requires.

Anyway, if you need help with upgrades to Eclipse I would like to contribute.

Thanks!