Bug 491657 - Bindings have to be created within the validation realm
Summary: Bindings have to be created within the validation realm
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.8 M7   Edit
Assignee: Conrad Groth CLA
QA Contact: Conrad Groth CLA
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2016-04-14 04:25 EDT by Conrad Groth CLA
Modified: 2018-03-26 06:15 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Conrad Groth CLA 2016-04-14 04:25:42 EDT
Within org.eclipse.core.databinding.Binding.init(DataBindingContext) there is a call to org.eclipse.core.databinding.DataBindingContext.addBinding(Binding), which adds the new Binding to the observable lists validationStatusProviders and bindings. Both observable lists use the validation realm.

Idea: Surround the call to context.addBinding(this) in the Binding class with:
Binding.this.context.getValidationRealm().exec(new Runnable() {
    public void run() {
        context.addBinding(this);
    });
Comment 1 Eclipse Genie CLA 2016-04-18 10:46:30 EDT
New Gerrit change created: https://git.eclipse.org/r/70868
Comment 2 Lars Vogel CLA 2016-09-22 14:48:00 EDT
(In reply to Conrad Groth from comment #0)
> Within org.eclipse.core.databinding.Binding.init(DataBindingContext) there
> is a call to
> org.eclipse.core.databinding.DataBindingContext.addBinding(Binding), which
> adds the new Binding to the observable lists validationStatusProviders and
> bindings. Both observable lists use the validation realm.

Which problem are you trying to solve?
Comment 3 Conrad Groth CLA 2016-09-23 13:44:37 EDT
(In reply to Lars Vogel from comment #2)
> (In reply to Conrad Groth from comment #0)
> > Within org.eclipse.core.databinding.Binding.init(DataBindingContext) there
> > is a call to
> > org.eclipse.core.databinding.DataBindingContext.addBinding(Binding), which
> > adds the new Binding to the observable lists validationStatusProviders and
> > bindings. Both observable lists use the validation realm.
> 
> Which problem are you trying to solve?

If the validation realm is not the current realm during the creation of the binding, you will get an exception like "...not the current realm...".

Either there are not many people out there working with different realms or all of these people already implemented their own workaround, like I did that for the project I'm currently working on. The proposed patch contains exactly that code, I'm also using for my multi realm aware Binding classes in my project.
Comment 4 Lars Vogel CLA 2016-10-31 12:13:04 EDT
Mass move to M4.
Comment 5 Patrik Suzzi CLA 2017-12-12 04:13:51 EST
Conrad, could you please provide an example project that we can use to test your change?
Comment 7 Lars Vogel CLA 2018-03-26 06:15:20 EDT
Conrad, please add to N&N M7.