| Summary: | [DataBinding] Master/Detail with DuplexingObservableValue: Incorrect Update of Detail after Edit | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Yoshi <kacifro> | ||||||||
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> | ||||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | ||||||||||
| Version: | 4.2 | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | stalebug | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Yoshi
Created attachment 204512 [details]
JUnit 4 test case
Created attachment 204513 [details]
Proposed fix
Hello
It seems that the failure to update the text field has to do with a ValueChangeEvent, fired from DuplexingObservableValue, that contains a ValueDiff which in turn contains the same value ("Steven Spielberg" in the example) as both the old and new value, which makes the governing ValueBinding ignore the update of the Text field.
Ultimately, the bogus ValueDiff boils down to a stale value of the field DuplexingObservableValue.cachedValue. A fix would be to set said field in DuplexingObservableValue.doSetValue(Object).
Cf. attached JUnit test case and patch.
Regards
Created attachment 205049 [details]
Stipped-down test case
Hello
Obsoleting the previously attached stand-alone test case, I'm enclosing a patch to DuplexingObservableValueTest of the plug-in org.eclipse.jface.tests.databinding, adding a test method to demonstrate the problem.
In essence, the wrong value is returned by doGetValue() if there are listeners attached and the dirty flag is not set (as would be as a result of a change of the target list).
The previously proposed patch is still valid.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the "stalebug" whiteboard tag. |