Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359452 - [DataBinding] Master/Detail with DuplexingObservableValue: Incorrect Update of Detail after Edit
Summary: [DataBinding] Master/Detail with DuplexingObservableValue: Incorrect Update o...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-29 12:16 EDT by Yoshi CLA
Modified: 2019-11-14 03:36 EST (History)
0 users

See Also:


Attachments
JUnit 4 test case (3.64 KB, text/x-java)
2011-10-04 10:06 EDT, Yoshi CLA
no flags Details
Proposed fix (847 bytes, patch)
2011-10-04 10:06 EDT, Yoshi CLA
no flags Details | Diff
Stipped-down test case (1.67 KB, patch)
2011-10-12 12:51 EDT, Yoshi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yoshi CLA 2011-09-29 12:16:45 EDT
Build Identifier: M20100909-0800

Hi

Cf. steps to reproduce.

Pardon me if I'm missing something obvious...

Reproducible: Always

Steps to Reproduce:
1. Launch Snippet028DuplexingObservableValue.java.
2. Select the table row "Indiana Jones and the Kingdom of the Crystal Skull".
3. In the detail part, edit "Director" from "Steven Spielberg" to "xxx"; verify that this change is reflected in the master table.
4. Select the table row "Raiders of the Lost Ark". In the detail part, "xxx" shows up as "Director" instead of the expected "Steven Spielberg".
Comment 1 Yoshi CLA 2011-10-04 10:06:17 EDT
Created attachment 204512 [details]
JUnit 4 test case
Comment 2 Yoshi CLA 2011-10-04 10:06:59 EDT
Created attachment 204513 [details]
Proposed fix
Comment 3 Yoshi CLA 2011-10-04 10:08:31 EDT
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
Comment 4 Yoshi CLA 2011-10-12 12:51:20 EDT
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.
Comment 5 Lars Vogel CLA 2019-11-14 03:36:58 EST
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.