Bug 465578 - [GTK][32-bit] NoSuchMethodError: OS.gtk_settings_get_default()J from DarkThemeProcessor
Summary: [GTK][32-bit] NoSuchMethodError: OS.gtk_settings_get_default()J from DarkThem...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 4.5 M7   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 464781
Blocks:
  Show dependency tree
 
Reported: 2015-04-27 08:51 EDT by Markus Keller CLA
Modified: 2015-04-30 06:35 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2015-04-27 08:51:13 EDT
eclipse.buildId=4.5.0.I20150426-2000
java.version=1.7.0_67
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86

org.eclipse.ui
Error
Mon Apr 27 14:05:39 CEST 2015
Unhandled event loop exception

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NoSuchMethodError: org.eclipse.swt.internal.gtk.OS.gtk_settings_get_default()J)
	at org.eclipse.swt.SWT.error(SWT.java:4491)
	at org.eclipse.swt.SWT.error(SWT.java:4406)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3762)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3401)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	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:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Caused by: java.lang.NoSuchMethodError: org.eclipse.swt.internal.gtk.OS.gtk_settings_get_default()J
	at org.eclipse.e4.ui.swt.internal.gtk.DarkThemeProcessor$1$1.run(DarkThemeProcessor.java:53)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	... 23 more


In the 32-bit version of SWT, the non-API method OS.gtk_settings_get_default() has this signature:

public static final int gtk_settings_get_default() {}

You can't call this method from a non-SWT bundle (except via reflection). But instead of maintaining platform-specific code in an e4 fragment, you should ask SWT for proper API. If the functionality is absolutely necessary for 4.5, the platform-specific code should still be put into SWT. E4 can then at least reduce the illegal code to a single invocation of an internal method.

Please remove the @SuppressWarnings("restriction") in the DarkThemeProcessor and keep the discouraged access warnings visible. Filed bug 465577 to allow the build to disable this SuppressWarnings token.
Comment 1 Nobody - feel free to take it CLA 2015-04-28 05:14:33 EDT
Filed and submitted patch for Bug 465660
Comment 2 Nobody - feel free to take it CLA 2015-04-29 07:57:54 EDT
(In reply to Sopot Cela from comment #1)
> Filed and submitted patch for Bug 465660

SWT patch merged. Preparing patch to DarkThemeProcessor.
Comment 3 Lars Vogel CLA 2015-04-30 03:16:11 EDT
(In reply to Sopot Cela from comment #2)
> (In reply to Sopot Cela from comment #1)
> > Filed and submitted patch for Bug 465660
> 
> SWT patch merged. Preparing patch to DarkThemeProcessor.

Fixed by Sopot with commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=4d0a921e62a73a5e13a031d6995604464e857ee5
Comment 4 Markus Keller CLA 2015-04-30 06:35:00 EDT
Verified in I20150429-2000 that the exception is gone.