Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » [EMF DataBinding] - Getter called outside realm of observable(Could not create ObservableCollectionContentProvider into views)
[EMF DataBinding] - Getter called outside realm of observable [message #1100630] Tue, 03 September 2013 11:12 Go to next message
Philippe EUGENE is currently offline Philippe EUGENEFriend
Messages: 58
Registered: January 2011
Member
Hi,

My eclipse RCP Application working properly for several months.
But since Friday I have a bug that I could not resolve.

I have many views, with viewers. And the viewers are populate using jFace and EMF Databinding.

The code is very simply, like this :
...
master = new WritableValue();
master.setValue(anEOject);
...
ctx = new EMFDataBindingContext();
contentProvider = new ObservableListContentProvider();
...

The bug occured when creating new ObservableListContentProvider();

I know the source of the bug:
At this moment in views : Display.getCurrent() != Display.getDefault();

When created the provider => the default display is used
protected ObservableCollectionContentProvider(
IViewerUpdater explicitViewerUpdater) {
this.explicitViewerUpdater = explicitViewerUpdater;
...
display = Display.getDefault();

...

When checking if the realm is current : => the current dispay is used
public boolean isCurrent() {
return Display.getCurrent() == display;
}


The default Display is created by :
IDEWorkbenchPlugin.createProblemsViews => create the Default display in the Eventmanager Thread.

and after
Workbench.createAndRunWorkbench => create the default Realm using the Display in the main thread.


Is there a way to resolve this problem ?


Thanks for help.
--
Philippe EUGENE.
Re: [EMF DataBinding] - Getter called outside realm of observable [message #1100664 is a reply to message #1100630] Tue, 03 September 2013 12:17 Go to previous messageGo to next message
Philippe EUGENE is currently offline Philippe EUGENEFriend
Messages: 58
Registered: January 2011
Member
Sound like this ?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=332824
Re: [EMF DataBinding] - Getter called outside realm of observable [message #1100672 is a reply to message #1100664] Tue, 03 September 2013 12:30 Go to previous messageGo to next message
Philippe EUGENE is currently offline Philippe EUGENEFriend
Messages: 58
Registered: January 2011
Member
I could reproduce the bug with the sample application : Mail template.

1. Create the application with the wizard
2. Just add this line in the View :
ObservableListContentProvider contentProvider = new ObservableListContentProvider();
3. Launch the application => OK. All works fine.

For reproduce the bug :
4. Add the org.eclipse.ui.ide in the launch configuration (i force the autostart a true for launch the plugin, in my ownn product RCP the autostart is at the default value)
5. Launch the application => Reproduce the bug.

For information : my target Platform is a 3.7



[Updated on: Tue, 03 September 2013 12:32]

Report message to a moderator

Re: [EMF DataBinding] - Getter called outside realm of observable [message #1100726 is a reply to message #1100664] Tue, 03 September 2013 14:00 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Really this bug does not talk about realms.

Tom

On 03.09.13 14:17, Philippe EUGENE wrote:
> Sound like this ?
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332824
>
Re: [EMF DataBinding] - Getter called outside realm of observable [message #1100727 is a reply to message #1100672] Tue, 03 September 2013 14:01 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Well this means there are 2 display instance which sounds ultimately
wrong. So this sounds much more like a platform bug, right? There should
never ever be 2 Displays.

Tom

On 03.09.13 14:30, Philippe EUGENE wrote:
> I could reproduce the bug with the sample application : Mail template.
>
> 1. Create the application with the wizard
> 2. Just add this line in the View :
> ObservableListContentProvider contentProvider = new
> ObservableListContentProvider();
> 3. Launch the application => OK. All works fine.
>
> For reproduce the bug :
> 4. Add the org.eclipse.ui.ide in the launch configuration (i force the
> autostart a true for launch the plugin, in my ownn product RCP the
> autostart is at the default value)
> 5. Launch the application => Reproduce the bug.
>
>
>
>
Re: [EMF DataBinding] - Getter called outside realm of observable [message #1100737 is a reply to message #1100727] Tue, 03 September 2013 14:24 Go to previous messageGo to next message
Philippe EUGENE is currently offline Philippe EUGENEFriend
Messages: 58
Registered: January 2011
Member
Tom,
Thanks for reply.

Well there is two things :
1. Effectively i have two display created :

-> One by the IDEWorkbenchPlugin#createProblemsViews()
Try to acquire the current display. In my case current display is null.
Then create and acquire the Default display. This display become the default in the Display.class
All this code was run in the EventManager Thread.

-> The second by the Workbench => This display is associated to the main Thread.

This behavior is strange.


2. The second things seems to be a bug in ObservableCollectionContentProvider.
The constructor use the Default display by this call :
display = Display.getDefault();

Why not using the current Display associated with the current Thread ?

--
Philippe


Re: [EMF DataBinding] - Getter called outside realm of observable [message #1101374 is a reply to message #1100737] Wed, 04 September 2013 11:26 Go to previous message
Philippe EUGENE is currently offline Philippe EUGENEFriend
Messages: 58
Registered: January 2011
Member
I open a ticket in bugzilla
https://bugs.eclipse.org/bugs/show_bug.cgi?id=416511
Previous Topic:Programmatic Execution of Commands is Logged as an Error
Next Topic:Take screenshot of RCP application window
Goto Forum:
  


Current Time: Sat Apr 20 05:17:53 GMT 2024

Powered by FUDForum. Page generated in 0.03338 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top