Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 296011

Summary: [DataBinding] Observe detail value with interface type causes BindingException
Product: [Eclipse Project] Platform Reporter: Tillmann Seidel <tseidel>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: RESOLVED DUPLICATE QA Contact: Matthew Hall <qualidafial>
Severity: normal    
Priority: P3 CC: mallo.ovidio
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Java code demonstrating the bug none

Description Tillmann Seidel CLA 2009-11-24 10:25:05 EST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10
Build Identifier: Eclipse 3.4.2 M20090211-1700

org.eclipse.core.databinding.beans (1.1.1.M20080827-0800a)

The cause for the problem is that BeansObservables.getPropertyDescriptor uses Introspector.getBeanInfo(beanClass). When called with an interface parameter, the resulting PropertyDescriptor does not contain properties from the parent interface(s) (see JavaDoc of Class.getSuperClass()). 

Reproducible: Always

Steps to Reproduce:
1. Create a class "Master" and interfaces "IChild" and "IParent"
2. IChild extends IParent
3. IParent has a getter for a String property "name"
4. Master has a getter "IChild getChild()"
5. Create a master observable on an instance of "Master"
6. Create a detail observable on the "name" property of the child of the Master
-> org.eclipse.core.databinding.BindingException: Could not find property with name name in class interface databindingbug.IChild
Comment 1 Tillmann Seidel CLA 2009-11-24 10:26:10 EST
Created attachment 152957 [details]
Java code demonstrating the bug
Comment 2 Ovidio Mallo CLA 2010-03-21 14:15:36 EDT
Tillmann, this problem had already been reported in bug 256150 and it is already fixed since Eclipse 3.5. In fact, the snippet you have provided is working fine for me. You might want to check whether it's possible for you to switch to the newer version of the databinding plugins.
Comment 3 Ovidio Mallo CLA 2010-03-22 14:34:54 EDT
This is a duplicate of bug bug 256150 which has already been fixed.

*** This bug has been marked as a duplicate of bug 256150 ***
Comment 4 Tillmann Seidel CLA 2010-03-26 11:03:54 EDT
Thanks Ovidio for the hint. It's working fine in Eclipse 3.5.1. 

We can't switch to a newer version right now, but duplicating the getter in the child interface is ok as a workaround until we can switch.