CodesAway / BEXCodeCompare

Be Enhanced Code Compare
BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

Exception while trying to run BEX Code Compare in diff view (BufferedCanvas cannot be found) #121

Open kiicia opened 3 years ago

kiicia commented 3 years ago

I am using Eclipse:

Version: 2021-06 (4.20.0)
Build id: 20210612-2011

I have installed BEX Code Compare via Eclipse Marketplace

When I am in diff view and try to select BEX Code Compare from list, then visually nothing happens and error log contains:

org.eclipse.ui
Error
Unhandled event loop exception
java.lang.NoClassDefFoundError: org/eclipse/compare/internal/BufferedCanvas
    at info.codesaway.eclipse.jdt.internal.ui.compare.JavaContentViewerCreator.createViewer(JavaContentViewerCreator.java:32)
    at org.eclipse.compare.internal.ViewerDescriptor.createViewer(ViewerDescriptor.java:66)
    at org.eclipse.compare.CompareEditorInput.findContentViewer(CompareEditorInput.java:915)
    at org.eclipse.egit.ui.internal.merge.GitMergeEditorInput.findContentViewer(GitMergeEditorInput.java:194)
    at org.eclipse.compare.internal.CompareContentViewerSwitchingPane.getViewer(CompareContentViewerSwitchingPane.java:89)
    at org.eclipse.compare.CompareViewerSwitchingPane.setInput(CompareViewerSwitchingPane.java:257)
    at org.eclipse.compare.internal.CompareContentViewerSwitchingPane.setInput(CompareContentViewerSwitchingPane.java:202)
    at org.eclipse.compare.internal.CompareContentViewerSwitchingPane$6.widgetSelected(CompareContentViewerSwitchingPane.java:280)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4209)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1043)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4026)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3626)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:654)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1462)
Caused by: java.lang.ClassNotFoundException: org.eclipse.compare.internal.BufferedCanvas cannot be found by info.codesaway.bex_0.5.0.202010271910
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:519)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:170)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 35 more
java.version=11.0.10
java.vendor=Amazon.com Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product -data file:/C:/Users/{redacted}/eclipse-workspace/ -product org.eclipse.epp.package.jee.product
CodesAway commented 3 years ago

Thanks for the bug report. I'll install this version of Eclipse and test it, hopefully I can reproduce the issue which will facilitate testing.

CodesAway commented 3 years ago

@kiicia I'm still investigating this. I found the following fixed Eclipse bug which I think resulted in be bug in BEX.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=571954

When I had to include internal Eclipse classes into BEX it always felt wrong. However, I didn't find a better way to do it. I'll investigate and see if I can remove the need for the internal classes. The issue with internal classes is if they change something internal, then it breaks BEX, which is not ideal.

CodesAway commented 3 years ago

For my reference, looks like I need to merge their changes to TextMergeViewer

https://git.eclipse.org/c/platform/eclipse.platform.team.git/tree/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java

Ideally, I can find a way to implement this class without copying their version of the class as the base.