Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 515965 - org.eclipse.e4.ui.swt.gtk java Access restriction compile error due to OS.setDarkThemePreferred()
Summary: org.eclipse.e4.ui.swt.gtk java Access restriction compile error due to OS.set...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.7 M7   Edit
Assignee: Leo Ufimtsev CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-28 11:48 EDT by Leo Ufimtsev CLA
Modified: 2017-05-01 13:16 EDT (History)
1 user (show)

See Also:


Attachments
Demonstration of issue screenshot (301.65 KB, image/png)
2017-04-28 11:48 EDT, Leo Ufimtsev CLA
no flags Details
Config to prevent the warning screenshot (104.53 KB, image/png)
2017-04-28 11:49 EDT, Leo Ufimtsev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Ufimtsev CLA 2017-04-28 11:48:26 EDT
With default Eclipse settings, org.eclipse.e4.ui.swt.gtk has a java compile errors:
"Access restriction: The method OS.setDarkThemePreferred(boolean)' is not API (restriction on required project 'org.eclipse.swt').

Due to this, the project fails to compile and I can't launch child-eclipse with dark mode.
I have to hack a bit to get the project to work.

One solution is to override the default and set Java->Compiler->Errors/Warnings -> change "Forbidden reference (acess rules) from 'Error' to 'Warning'.

Patch incoming.
Comment 1 Leo Ufimtsev CLA 2017-04-28 11:48:56 EDT
Created attachment 268069 [details]
Demonstration of issue screenshot
Comment 2 Leo Ufimtsev CLA 2017-04-28 11:49:18 EDT
Created attachment 268070 [details]
Config to prevent the warning screenshot
Comment 3 Eclipse Genie CLA 2017-04-28 11:51:21 EDT
New Gerrit change created: https://git.eclipse.org/r/96045
Comment 5 Eclipse Genie CLA 2017-04-28 13:03:13 EDT
New Gerrit change created: https://git.eclipse.org/r/96053
Comment 6 Leo Ufimtsev CLA 2017-04-28 13:05:57 EDT
(In reply to Eclipse Genie from comment #5)
> New Gerrit change created: https://git.eclipse.org/r/96053

After further investigation, I found that the root cause was an issue in my target platform. I had "org.eclipse.swt.gtk.linux.x86_64" turned off, so that I wouldn't see duplicate calls in call-hierarchy, but this had an impact on org.eclipse.e4.ui.swt.gtk. Re-enabling it enabled theming engine to work again. As such, reverting the customization in options.
Comment 7 Eclipse Genie CLA 2017-04-28 13:36:28 EDT
New Gerrit change created: https://git.eclipse.org/r/96057
Comment 8 Leo Ufimtsev CLA 2017-04-28 13:37:43 EDT
(In reply to Eclipse Genie from comment #7)
> New Gerrit change created: https://git.eclipse.org/r/96057

Better patch that keeps static settings for org.ecilpse.e4.ui.swt.gtk project.