Bug 312451 - Accessible.addRelations should check if target == null
Summary: Accessible.addRelations should check if target == null
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: 4.6.2   Edit
Assignee: Leo Ufimtsev CLA
QA Contact: Leo Ufimtsev CLA
URL:
Whiteboard:
Keywords: accessibility, api
: 418164 495515 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-11 11:37 EDT by Carolyn MacLeod CLA
Modified: 2016-11-16 13:15 EST (History)
13 users (show)

See Also:
arunkumar.thondapu: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carolyn MacLeod CLA 2010-05-11 11:37:05 EDT
Either throw an error or do nothing - need to decide.
Comment 1 Marcel CLA 2011-11-07 07:37:04 EST
Our customers are hit by this regularly... Is there any chance for a fix?

Caused by: java.lang.NullPointerException
        at org.eclipse.swt.accessibility.AccessibleObject.addRelation(AccessibleObject.java:3514)
        at org.eclipse.swt.accessibility.Accessible.addRelations(Accessible.java:423)
        at org.eclipse.swt.accessibility.AccessibleFactory.atkObjectFactory_create_accessible(AccessibleFactory.java:342)
        at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
        at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2276)
Comment 2 Carolyn MacLeod CLA 2011-11-07 16:12:36 EST
Interesting. I didn't expect anyone to run into this problem - I just wanted to think about it for API cleanup. Do your customers truly make calls similar to the following?
   control.getAccessible().addRelation(ACC.RELATION_LABELLED_BY, null);
Comment 3 Marcel CLA 2011-11-08 02:22:16 EST
The problem is that we have no idea how this can happen. In our application we never call addRelation and it is unclear what leads to the NPE. These NPEs are happening about 3-5 times a day (Linux userbase about 2000 daily). In the past it happened once or twice to the same user but then worked fine again. Since yesterday we have a user where it happens all the times. According to him he did not install/run any accessibility tool.
I guess that about 80% are gtk-32bit, the rest gtk-64bit.
Our customers can not extend our application, they just use it.
Comment 4 Carolyn MacLeod CLA 2011-11-08 10:26:21 EST
> In our application we never call addRelation and it is unclear what leads to the NPE.

Thanks, Marcel - useful information. I will see if I can find a possible path that could lead to this NPE even if addRelation is not called.
Comment 5 Carolyn MacLeod CLA 2011-11-08 10:55:34 EST
There are a couple of possible paths I can follow, but it would help to narrow it down if you can tell me if you call any of these methods:

Change the Z-order of a control:
org.eclipse.swt.widgets.Control.moveAbove(Control)
org.eclipse.swt.widgets.Control.moveBelow(Control)

Change the parent of a control:
org.eclipse.swt.widgets.Control.setParent(Composite)
Comment 6 Marcel CLA 2011-11-09 03:29:36 EST
I added a null-check (target != null) to AccessibleObject, but it still happens. It seems that the target is non-null, but target.getAccessibleObject() returns null in some cases.

We use (if this is still relevant)
- moveAbove: in some places, but the NPE happens sometimes right after startup, where this is not called yet (the respective control not created yet)
- moveBelow: no
- setParent: no
Comment 8 Andrey Loskutov CLA 2016-08-01 12:37:46 EDT
*** Bug 418164 has been marked as a duplicate of this bug. ***
Comment 9 Jeff Johnston CLA 2016-08-02 14:36:03 EDT
*** Bug 495515 has been marked as a duplicate of this bug. ***
Comment 10 Eclipse Genie CLA 2016-08-09 11:47:18 EDT
New Gerrit change created: https://git.eclipse.org/r/78700
Comment 11 Leo Ufimtsev CLA 2016-08-09 12:00:17 EDT
(In reply to Eclipse Genie from comment #10)
> New Gerrit change created: https://git.eclipse.org/r/78700

I added null checks around the public API that could potentially lead to a null  target. This way we could tell what adds null objects before they lead to a crash.
This also allows clients to put the addRelation() and removeRelation() calls into try/catch clauses to prevent crashes.

I'm not sure if this can be classified as api change. This may be an *implicit* api change, in that it throws an unchecked exception:
https://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html
I.e, previous code doesn't have to be modified, but new code can add try/catch around a call to that api. Does anyone know if this is considered api change?
Comment 12 Leo Ufimtsev CLA 2016-08-10 13:24:48 EDT
As discussed on mailing list, as per:

http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fapi-usage-rules.html
"Null parameters. Do not pass null as a parameter to an API method unless the parameter is explicitly documented as allowing null. This is perhaps the most frequently made programming error."

I.e on the grounds that API doesn't allow null to begin with, we can consider this as non-api change. Thus can go ahead with merge afaik.
Comment 14 Eric Williams CLA 2016-08-18 11:14:49 EDT
(In reply to Eclipse Genie from comment #13)
> Gerrit change https://git.eclipse.org/r/78700 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=d5aaf6787e634fc7205b27242335ef52d1b330a1

In master now, thanks for the patch Leo!
Comment 15 Dani Megert CLA 2016-09-06 08:43:37 EDT
This is a good candidate for 4.6.2
Comment 16 Markus Keller CLA 2016-09-06 11:34:41 EDT
Leo, https://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg08006.html and comment 6 indicate that the problem is not that the 'target' passed to AccessibleObject.addRelation(..) is null, but that 'target.getAccessibleObject()' is null.

Gurmeen, do you have steps to reproduce?
Comment 17 Gurmeen Bindra CLA 2016-09-06 11:54:08 EDT
I am not sure as I see it as part of existing UI when expanding tree item or selecting text to copy to clipboard.


The gtk version that I see the crash: Version: 3.18.9-1ubuntu3.1
OS version- 	Ubuntu
Description:	Ubuntu 16.04.1 LTS
Comment 18 Gurmeen Bindra CLA 2016-09-06 12:12:28 EDT
Its on unity desktop version on unix.
Comment 19 Leo Ufimtsev CLA 2016-09-06 12:30:07 EDT
(In reply to Markus Keller from comment #16)
> Leo, https://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg08006.html
> and comment 6 indicate that the problem is not that the 'target' passed to
> AccessibleObject.addRelation(..) is null, but that
> 'target.getAccessibleObject()' is null.
> 
> Gurmeen, do you have steps to reproduce?

Hello Markus, 

The logic here was that in order to stop getAccessibleObject() from returning a null, the user should not be permitted to add a null-object to begin with. Theoretically that should fix things. 
(Unless something sets an added an accessibleObject to null after it was added?, in which case we could add more null-checks)
Thoughts?
Comment 20 Leo Ufimtsev CLA 2016-09-06 12:38:40 EDT
I backported null checks here:
https://git.eclipse.org/r/#/c/80507/

@ Markus/other, if the patch doesn't fix the problem or I missed something, please kindly re-open this bug and let me know response to #19.

Thank you
Comment 21 Markus Keller CLA 2016-09-06 13:25:02 EDT
(In reply to Leo Ufimtsev from comment #20)
I've reverted that commit with https://git.eclipse.org/r/80508.

R4_6_maintenance is closed until 4.6.1 is declared, and you would have required an independent code review for the backport anyway. See https://www.eclipse.org/eclipse/development/plans/freeze_plan_4_6_1.php
Comment 22 Markus Keller CLA 2016-09-06 13:37:38 EDT
(In reply to Leo Ufimtsev from comment #19)
> The logic here was that in order to stop getAccessibleObject() from
> returning a null, the user should not be permitted to add a null-object to
> begin with.

The Accessible#accessibleObject field is not set by the user. SWT is supposed to create and store this object when necessary. The bug is that the object either didn't get created or that it got released too early.
Comment 23 Leo Ufimtsev CLA 2016-09-06 15:36:02 EDT
(In reply to Markus Keller from comment #21)
> (In reply to Leo Ufimtsev from comment #20)
> I've reverted that commit with https://git.eclipse.org/r/80508.
> 
> R4_6_maintenance is closed until 4.6.1 is declared, and you would have
> required an independent code review for the backport anyway. See
> https://www.eclipse.org/eclipse/development/plans/freeze_plan_4_6_1.php
Thank you, I should have read the freeze plan more attentively.

(In reply to Markus Keller from comment #22)
> (In reply to Leo Ufimtsev from comment #19)
> > The logic here was that in order to stop getAccessibleObject() from
> > returning a null, the user should not be permitted to add a null-object to
> > begin with.
> 
> The Accessible#accessibleObject field is not set by the user. SWT is
> supposed to create and store this object when necessary. The bug is that the
> object either didn't get created or that it got released too early.
I see. 
I submitted a tennative patch to check for a null. It checks for null in Accessible.addRelations() that is simmilar to Accessible.addRelation():
https://git.eclipse.org/r/#/c/80520/
Those are the only two methods were AccessibleObject:addRelation() is called.

A snippet or steps to reproduce would help with finding the root cause, but this 
patch should at least prevent crashes.

I added you as reviewer, would you be able to take a look and let me know your thoughts?

Thank you.
Comment 24 Eclipse Genie CLA 2016-09-06 16:51:34 EDT
New Gerrit change created: https://git.eclipse.org/r/80507
Comment 26 Eclipse Genie CLA 2016-09-06 16:51:41 EDT
New Gerrit change created: https://git.eclipse.org/r/80508
Comment 28 Eclipse Genie CLA 2016-09-06 16:52:23 EDT
New Gerrit change created: https://git.eclipse.org/r/80520
Comment 29 Gurmeen Bindra CLA 2016-09-07 04:37:00 EDT
(In reply to Leo Ufimtsev from comment #23)
> (In reply to Markus Keller from comment #21)
> > (In reply to Leo Ufimtsev from comment #20)
> > I've reverted that commit with https://git.eclipse.org/r/80508.
> > 
> > R4_6_maintenance is closed until 4.6.1 is declared, and you would have
> > required an independent code review for the backport anyway. See
> > https://www.eclipse.org/eclipse/development/plans/freeze_plan_4_6_1.php
> Thank you, I should have read the freeze plan more attentively.
> 
> (In reply to Markus Keller from comment #22)
> > (In reply to Leo Ufimtsev from comment #19)
> > > The logic here was that in order to stop getAccessibleObject() from
> > > returning a null, the user should not be permitted to add a null-object to
> > > begin with.
> > 
> > The Accessible#accessibleObject field is not set by the user. SWT is
> > supposed to create and store this object when necessary. The bug is that the
> > object either didn't get created or that it got released too early.
> I see. 
> I submitted a tennative patch to check for a null. It checks for null in
> Accessible.addRelations() that is simmilar to Accessible.addRelation():
> https://git.eclipse.org/r/#/c/80520/
> Those are the only two methods were AccessibleObject:addRelation() is called.
> 
> A snippet or steps to reproduce would help with finding the root cause, but
> this 
> patch should at least prevent crashes.
> 
> I added you as reviewer, would you be able to take a look and let me know
> your thoughts?
> 
> Thank you.

If I have access to a drop of swt 4.5 then I can verify it. I first saw the problem in 4.3 then upgraded to 4.5 and then to 4.7 drop and still see the problem. I see it with one of SWT GUIs in many scenarios but not with others so not sure of the steps. I will try and if I am able to get the steps - shall post it. I am happy to test the drops on latest package though. Thanks
Comment 30 Eclipse Genie CLA 2016-09-07 12:30:52 EDT
New Gerrit change created: https://git.eclipse.org/r/80609
Comment 31 Markus Keller CLA 2016-09-07 12:32:02 EDT
(In reply to Leo Ufimtsev from comment #23)
> https://git.eclipse.org/r/#/c/80520/

Exactly the same check is already made three lines earlier (line 430), so if this would change anything, then it would indicate a race condition and the "fix" would only work by pure chance. If we just wanted to get rid of the NPE without trying to understand the actual reason, then the check would have to go into AccessibleObject#addRelation(int, Accessible) like this:

https://git.eclipse.org/r/80609
Comment 32 Leo Ufimtsev CLA 2016-09-08 09:41:46 EDT
(In reply to comment #31)
> (In reply to Leo Ufimtsev from comment #23)
> > https://git.eclipse.org/r/#/c/80520/
> 
> Exactly the same check is already made three lines earlier (line 430), so if
> this would change anything, then it would indicate a race condition and the
> "fix" would only work by pure chance. If we just wanted to get rid of the NPE
> without trying to understand the actual reason, then the check would have to go
> into AccessibleObject#addRelation(int, Accessible) like this:
> 
> https://git.eclipse.org/r/80609

I see. I've miss-read the stack trace, I thought AccessibleObject was the null object. Thank you for correction.
Given that we can't really reproduce the issue, it's hard to perform a deep investigation. I think fix would work for now.
Comment 34 Gurmeen Bindra CLA 2016-09-09 05:11:17 EDT
If you could provide us with a drop on 4.5 or latest, I shall be happy to verify the fix.
Comment 35 Leo Ufimtsev CLA 2016-09-09 10:13:48 EDT
@Gurmeen, 
Yesterday's build contained the fix:
http://download.eclipse.org/eclipse/downloads/  -> Nightly -> N2016xxxxxxxxxx   (8th sept).

To tell:
http://download.eclipse.org/eclipse/downloads/drops4/N20160908-2000/directory.txt 
contains Markus's commit:
"a31e66b6450374405a04b72f094dc49ee2c0846f eclipse.platform.swt (R4_6-158-ga31e66b)"

Let us know how it goes.
Comment 36 Gurmeen Bindra CLA 2016-09-09 11:49:52 EDT
Thanks for the fix - it seems to work.
However, I noted a similar problem in removeRelation:
java.lang.NullPointerException
        at org.eclipse.swt.accessibility.AccessibleObject.removeRelation(Unknown Source)
        at org.eclipse.swt.accessibility.Accessible.removeRelation(Unknown Source)
        at org.eclipse.swt.widgets.Control.removeRelation(Unknown Source)
        at org.eclipse.swt.widgets.Control.release(Unknown Source)
        at org.eclipse.swt.widgets.Widget.dispose(Unknown Source)
        at com.isode.ddm.editor.EEF_DN.deleteRow(EEF_DN.java:627)


Adding a similar check in removeRelation seems to fix the problem, so it might be good to add this to removeRelation as well.
It would also help if this fix can be backported to old releases.
Comment 37 Gurmeen Bindra CLA 2016-09-20 05:06:27 EDT
It would be helpful to know if the remove relation fix will be included as part of this fix ?
Also it would be useful to know the timescale of when this fix intended to be released and whether it will be backported to 4.3 as well.
Comment 38 Leo Ufimtsev CLA 2016-09-23 11:08:20 EDT
(In reply to Gurmeen Bindra from comment #37)
> It would be helpful to know if the remove relation fix will be included as
> part of this fix ?
> Also it would be useful to know the timescale of when this fix intended to
> be released and whether it will be backported to 4.3 as well.

Sorry for the dealy. I'll try to add those next week sometime.
Comment 39 Eclipse Genie CLA 2016-09-30 12:07:14 EDT
New Gerrit change created: https://git.eclipse.org/r/82292
Comment 40 Eclipse Genie CLA 2016-09-30 12:11:40 EDT
New Gerrit change created: https://git.eclipse.org/r/82294
Comment 41 Leo Ufimtsev CLA 2016-09-30 12:17:03 EDT
(In reply to Eclipse Genie from comment #40)
> New Gerrit change created: https://git.eclipse.org/r/82294

Ignore #39. 
#40 adds a nullcheck to the method similar to previous patches.

@Gurmeen Bindra
Awaiting review of patch and update on if it fixes things (at least for now) for you..
Comment 42 Gurmeen Bindra CLA 2016-10-03 08:46:48 EDT
Thanks for fixing this Leo.
could you point me to the swt.jar that has the fix ?
Comment 43 Gurmeen Bindra CLA 2016-10-03 09:11:11 EDT
I think I  can pick up a nightly build:
http://download.eclipse.org/eclipse/downloads/drops4/N20161002-2000/download.php?dropFile=swt-N20161002-2000-gtk-linux-x86_64.zip

Will test this and get back to you. If this gets fixed, will be very very helpful if this could be ported back to 4.3.
Comment 44 Leo Ufimtsev CLA 2016-10-03 09:23:13 EDT
(In reply to comment #43)
> I think I  can pick up a nightly build:
> http://download.eclipse.org/eclipse/downloads/drops4/N20161002-2000/download.php?dropFile=swt-N20161002-2000-gtk-linux-x86_64.zip
> 
> Will test this and get back to you. If this gets fixed, will be very very
> helpful if this could be ported back to 4.3.

Ok. Let me know. 

Also, once testing is done: By 4.3 do you mean 4.3 or the latest 4.6 maintenance branch? (R4_6_maintenance)
Comment 45 Gurmeen Bindra CLA 2016-10-03 09:28:11 EDT
I tested and it did not work because the change is still in gerrit and has not been committed yet ! So its not in the nightly builds.
By 4.3 , I meant swt/eclipse version 4.3.2.
Comment 47 Gurmeen Bindra CLA 2016-10-05 10:09:01 EDT
I think the downloads link is not working:
download.eclipse.org/eclipse/downloads/drops4/N20161004-2000/
Comment 48 Leo Ufimtsev CLA 2016-10-05 10:40:38 EDT
(In reply to Gurmeen Bindra from comment #47)
> I think the downloads link is not working:
> download.eclipse.org/eclipse/downloads/drops4/N20161004-2000/

The build is generated, but there is an issue with a proxy and thus web links are not working since monday. They're working on it.

Please see:
Bug 503388 – Unable to access eclipse update sites from releng hipp https://bugs.eclipse.org/bugs/show_bug.cgi?id=503388

Hopefully should work by tomorrow.
Comment 49 Markus Keller CLA 2016-10-05 11:07:23 EDT
The workaround in removeRelation(..) has been pushed and is in http://download.eclipse.org/eclipse/downloads/drops4/I20161004-1000/ . We're currently having trouble with generating the download page and running tests, but the produced build is usable.

We'll backport the fix to the 4.6.2 branch after it has been tested in at least 2 successful weekly I-builds.

We don't produce builds for older maintenance branches any more. If you need it in 4.3, you'll have to build it yourself or go via https://lts.eclipse.org/ .
Comment 50 Leo Ufimtsev CLA 2016-10-05 12:18:41 EDT
(In reply to Markus Keller from comment #49)
> The workaround in removeRelation(..) has been pushed and is in
> http://download.eclipse.org/eclipse/downloads/drops4/I20161004-1000/ . We're
> currently having trouble with generating the download page and running
> tests, but the produced build is usable.
> 
> We'll backport the fix to the 4.6.2 branch after it has been tested in at
> least 2 successful weekly I-builds.
> 
> We don't produce builds for older maintenance branches any more. If you need
> it in 4.3, you'll have to build it yourself or go via
> https://lts.eclipse.org/ .

I could potentially backport the few patches to R4_3_maintenance? (@Markus thoughts? any problems with that?). 
However, you'd still have to build Eclipse/SWT bits yourself thou.. 
If that is of any use to you, let me know.
Comment 51 Gurmeen Bindra CLA 2016-10-06 04:31:38 EDT
that would be nice if it is backported to 4.3 - we could build it without modifying the code and hence avoid licensing issues if any.
Comment 52 Gurmeen Bindra CLA 2016-10-06 05:45:49 EDT
Tested - the fix works fine for me.
Thank you.
Comment 53 Leo Ufimtsev CLA 2016-10-06 10:13:11 EDT
(In reply to comment #51)
> that would be nice if it is backported to 4.3 - we could build it without
> modifying the code and hence avoid licensing issues if any.

Ok, kewl. 

I'll look into backporting.
Comment 54 Leo Ufimtsev CLA 2016-10-06 11:21:05 EDT
(In reply to Leo Ufimtsev from comment #53)
> (In reply to comment #51)
> > that would be nice if it is backported to 4.3 - we could build it without
> > modifying the code and hence avoid licensing issues if any.
> 
> Ok, kewl. 
> 
> I'll look into backporting.

Hmm, it seems like we normally don't backport all the way back to older versions. 
I've asked on the swt mailing list if we can make a one-off exception for this bug. If there won't be any objections by Oct 11 th, I'll go ahead with 4.3 backport.
Comment 55 Gurmeen Bindra CLA 2016-10-06 11:21:46 EDT
thanks !
Comment 56 Markus Keller CLA 2016-10-06 13:28:14 EDT
(In reply to Leo Ufimtsev from comment #50)
> I could potentially backport the few patches to R4_3_maintenance? (@Markus
> thoughts? any problems with that?).

We only do that rarely, and only after the fix has been backported and tested in the active maintenance branch for a while.

To backport to out-of-service branches, a few things need to be done carefully:
- Create a new bug, set its target milestone to the oldest x.y.z+ version, and make sure it depends on the original bug
- Also backport the fix to *all* maintenance branches that are newer than the one you're interested in. This is important for consumers. E.g. moving from 4.3.2+ to 4.4.2+ must not lose any backported fixes.
- Make sure you correctly update all necessary bundle and feature version numbers (i.e. all features that contain SWT). E.g. adding 0.0.1 everywhere would be wrong.
- Test the fix in all branches.

For the concrete use case, an easier way to avoid any and all licensing issues is to create a patch with the changes for the 4.3 branch and attach it here.
Comment 57 Leo Ufimtsev CLA 2016-10-07 10:18:06 EDT
(In reply to Markus Keller from comment #56)
> (In reply to Leo Ufimtsev from comment #50)
> > I could potentially backport the few patches to R4_3_maintenance? (@Markus
> > thoughts? any problems with that?).
> 
> We only do that rarely, and only after the fix has been backported and
> tested in the active maintenance branch for a while.
> 
> To backport to out-of-service branches, a few things need to be done
> carefully:
> - Create a new bug, set its target milestone to the oldest x.y.z+ version,
> and make sure it depends on the original bug
> - Also backport the fix to *all* maintenance branches that are newer than
> the one you're interested in. This is important for consumers. E.g. moving
> from 4.3.2+ to 4.4.2+ must not lose any backported fixes.
> - Make sure you correctly update all necessary bundle and feature version
> numbers (i.e. all features that contain SWT). E.g. adding 0.0.1 everywhere
> would be wrong.
> - Test the fix in all branches.
> 
> For the concrete use case, an easier way to avoid any and all licensing
> issues is to create a patch with the changes for the 4.3 branch and attach
> it here.

Also got a reply from Dani.M:
"you will need a +1 from an SWT project lead in the bug report."

@Markus
Thank you very much for taking the time to do this write up. I made a note of it in the swt wiki:
https://wiki.eclipse.org/SWT/Devel/Workflow#Note_about_backporting_to_versions_earlier_than_n-1

I see. Backporting so far back is much more demanding than I had anticipated. 

@Gurmeen
Given the complexity involved, I won't have the time to go through all of that.
At the moment the wayland migration ( Bug 496923 – [Wayland] Improve support for Wayland in 4.7 ) and the webkit2 port are more pressing.

However, I can backport these to R4_6_Maintenance. (I'll do next week).
 
If you can get a +1 from the SWT project lead and are willing to submit relevant patches, then I could review/merge them for you thou.
Comment 58 Gurmeen Bindra CLA 2016-10-07 10:44:55 EDT
Backporting to 4.6 wont be much help to us.
When is the next eclipse release with this fix expected ?
Comment 59 Leo Ufimtsev CLA 2016-10-11 11:56:14 EDT
(In reply to Gurmeen Bindra from comment #58)
> Backporting to 4.6 wont be much help to us.
> When is the next eclipse release with this fix expected ?

If I'm not mistaken:
https://wiki.eclipse.org/Simultaneous_Release

.2 will be released in: December 21, 2016 

If of use, and things work well, let me know and I'll backport current patches to R4_6_Maintenance.
Comment 60 Leo Ufimtsev CLA 2016-11-09 10:23:01 EST
If there is no use for backporting, should we close the bug?
Comment 61 Gurmeen Bindra CLA 2016-11-09 10:24:07 EST
yes, please.
Comment 62 Arun Thondapu CLA 2016-11-16 13:15:59 EST
I've backported the relevant changes (squashed into a single commit) to 4.6.2 via http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R4_6_maintenance&id=83d34538078cfcb43e1bd9344d645859ecc8e2ae