Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 128961 Details for
Bug 262284
[DataBinding] Properties should verify the source object is the expected type before constructing observables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch
clipboard.txt (text/plain), 15.22 KB, created by
Matthew Hall
on 2009-03-16 13:54:53 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Matthew Hall
Created:
2009-03-16 13:54:53 EDT
Size:
15.22 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.databinding.beans >Index: src/org/eclipse/core/internal/databinding/beans/BeanPropertyHelper.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/beans/BeanPropertyHelper.java,v >retrieving revision 1.5 >diff -u -r1.5 BeanPropertyHelper.java >--- src/org/eclipse/core/internal/databinding/beans/BeanPropertyHelper.java 5 Mar 2009 19:12:01 -0000 1.5 >+++ src/org/eclipse/core/internal/databinding/beans/BeanPropertyHelper.java 16 Mar 2009 17:51:34 -0000 >@@ -209,7 +209,7 @@ > * @param propertyName > * @return property descriptor or <code>null</code> > */ >- /* package */public static PropertyDescriptor getValueTypePropertyDescriptor( >+ public static PropertyDescriptor getValueTypePropertyDescriptor( > IObservableValue observable, String propertyName) { > if (observable.getValueType() != null) > return getPropertyDescriptor((Class) observable.getValueType(), >#P org.eclipse.jface.databinding >Index: src/org/eclipse/jface/internal/databinding/viewers/ViewerInputProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/viewers/ViewerInputProperty.java,v >retrieving revision 1.3 >diff -u -r1.3 ViewerInputProperty.java >--- src/org/eclipse/jface/internal/databinding/viewers/ViewerInputProperty.java 3 Feb 2009 15:20:09 -0000 1.3 >+++ src/org/eclipse/jface/internal/databinding/viewers/ViewerInputProperty.java 16 Mar 2009 17:51:36 -0000 >@@ -39,13 +39,6 @@ > return null; > } > >- protected void doAddListener(Object source, INativePropertyListener listener) { >- } >- >- protected void doRemoveListener(Object source, >- INativePropertyListener listener) { >- } >- > public String toString() { > return "Viewer.input"; //$NON-NLS-1$ > } >Index: src/org/eclipse/jface/databinding/swt/WidgetListProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/WidgetListProperty.java,v >retrieving revision 1.2 >diff -u -r1.2 WidgetListProperty.java >--- src/org/eclipse/jface/databinding/swt/WidgetListProperty.java 10 Feb 2009 18:53:04 -0000 1.2 >+++ src/org/eclipse/jface/databinding/swt/WidgetListProperty.java 16 Mar 2009 17:51:36 -0000 >@@ -34,10 +34,7 @@ > public abstract class WidgetListProperty extends SimpleListProperty implements > IWidgetListProperty { > public IObservableList observe(Object source) { >- if (source instanceof Widget) { >- return observe((Widget) source); >- } >- return super.observe(source); >+ return observe((Widget) source); > } > > public IObservableList observe(Realm realm, Object source) { >Index: src/org/eclipse/jface/databinding/swt/WidgetValueProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/WidgetValueProperty.java,v >retrieving revision 1.3 >diff -u -r1.3 WidgetValueProperty.java >--- src/org/eclipse/jface/databinding/swt/WidgetValueProperty.java 4 Mar 2009 01:03:58 -0000 1.3 >+++ src/org/eclipse/jface/databinding/swt/WidgetValueProperty.java 16 Mar 2009 17:51:36 -0000 >@@ -164,10 +164,7 @@ > } > > public IObservableValue observe(Object source) { >- if (source instanceof Widget) { >- return observe((Widget) source); >- } >- return super.observe(source); >+ return observe((Widget) source); > } > > public IObservableValue observe(Realm realm, Object source) { >#P org.eclipse.core.databinding.property >Index: src/org/eclipse/core/internal/databinding/property/set/SimplePropertyObservableSet.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding.property/src/org/eclipse/core/internal/databinding/property/set/SimplePropertyObservableSet.java,v >retrieving revision 1.4 >diff -u -r1.4 SimplePropertyObservableSet.java >--- src/org/eclipse/core/internal/databinding/property/set/SimplePropertyObservableSet.java 11 Mar 2009 21:51:48 -0000 1.4 >+++ src/org/eclipse/core/internal/databinding/property/set/SimplePropertyObservableSet.java 16 Mar 2009 17:51:37 -0000 >@@ -53,11 +53,26 @@ > * @param source > * @param property > */ >- public SimplePropertyObservableSet(Realm realm, Object source, >- SimpleSetProperty property) { >+ public SimplePropertyObservableSet(Realm realm, final Object source, >+ final SimpleSetProperty property) { > super(realm); > this.source = source; > this.property = property; >+ >+ Runnable typeCheck = new Runnable() { >+ public void run() { >+ try { >+ property.getSet(source); >+ } catch (RuntimeException e) { >+ dispose(); >+ throw e; >+ } >+ } >+ }; >+ if (realm.isCurrent()) >+ typeCheck.run(); >+ else >+ realm.exec(typeCheck); > } > > protected void firstListenerAdded() { >Index: src/org/eclipse/core/internal/databinding/property/set/SelfSetProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding.property/src/org/eclipse/core/internal/databinding/property/set/SelfSetProperty.java,v >retrieving revision 1.2 >diff -u -r1.2 SelfSetProperty.java >--- src/org/eclipse/core/internal/databinding/property/set/SelfSetProperty.java 11 Mar 2009 21:51:48 -0000 1.2 >+++ src/org/eclipse/core/internal/databinding/property/set/SelfSetProperty.java 16 Mar 2009 17:51:37 -0000 >@@ -49,11 +49,4 @@ > ISimplePropertyListener listener) { > return null; // no listener API > } >- >- protected void doAddListener(Object source, INativePropertyListener listener) { >- } >- >- protected void doRemoveListener(Object source, >- INativePropertyListener listener) { >- } > } >\ No newline at end of file >Index: src/org/eclipse/core/internal/databinding/property/value/SelfValueProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding.property/src/org/eclipse/core/internal/databinding/property/value/SelfValueProperty.java,v >retrieving revision 1.1 >diff -u -r1.1 SelfValueProperty.java >--- src/org/eclipse/core/internal/databinding/property/value/SelfValueProperty.java 6 Feb 2009 23:21:05 -0000 1.1 >+++ src/org/eclipse/core/internal/databinding/property/value/SelfValueProperty.java 16 Mar 2009 17:51:37 -0000 >@@ -44,11 +44,4 @@ > ISimplePropertyListener listener) { > return null; > } >- >- protected void doAddListener(Object source, INativePropertyListener listener) { >- } >- >- protected void doRemoveListener(Object source, >- INativePropertyListener listener) { >- } > } >\ No newline at end of file >Index: src/org/eclipse/core/internal/databinding/property/value/SimplePropertyObservableValue.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding.property/src/org/eclipse/core/internal/databinding/property/value/SimplePropertyObservableValue.java,v >retrieving revision 1.4 >diff -u -r1.4 SimplePropertyObservableValue.java >--- src/org/eclipse/core/internal/databinding/property/value/SimplePropertyObservableValue.java 4 Mar 2009 22:35:16 -0000 1.4 >+++ src/org/eclipse/core/internal/databinding/property/value/SimplePropertyObservableValue.java 16 Mar 2009 17:51:37 -0000 >@@ -45,11 +45,26 @@ > * @param source > * @param property > */ >- public SimplePropertyObservableValue(Realm realm, Object source, >- SimpleValueProperty property) { >+ public SimplePropertyObservableValue(Realm realm, final Object source, >+ final SimpleValueProperty property) { > super(realm); > this.source = source; > this.property = property; >+ >+ Runnable typeCheck = new Runnable() { >+ public void run() { >+ try { >+ property.getValue(source); >+ } catch (RuntimeException e) { >+ dispose(); >+ throw e; >+ } >+ } >+ }; >+ if (realm.isCurrent()) >+ typeCheck.run(); >+ else >+ realm.exec(typeCheck); > } > > protected void firstListenerAdded() { >Index: src/org/eclipse/core/internal/databinding/property/list/SimplePropertyObservableList.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding.property/src/org/eclipse/core/internal/databinding/property/list/SimplePropertyObservableList.java,v >retrieving revision 1.4 >diff -u -r1.4 SimplePropertyObservableList.java >--- src/org/eclipse/core/internal/databinding/property/list/SimplePropertyObservableList.java 11 Mar 2009 21:51:48 -0000 1.4 >+++ src/org/eclipse/core/internal/databinding/property/list/SimplePropertyObservableList.java 16 Mar 2009 17:51:37 -0000 >@@ -56,11 +56,26 @@ > * @param source > * @param property > */ >- public SimplePropertyObservableList(Realm realm, Object source, >- SimpleListProperty property) { >+ public SimplePropertyObservableList(Realm realm, final Object source, >+ final SimpleListProperty property) { > super(realm); > this.source = source; > this.property = property; >+ >+ Runnable typeCheck = new Runnable() { >+ public void run() { >+ try { >+ property.getList(source); >+ } catch (RuntimeException e) { >+ dispose(); >+ throw e; >+ } >+ } >+ }; >+ if (realm.isCurrent()) >+ typeCheck.run(); >+ else >+ realm.exec(typeCheck); > } > > protected void firstListenerAdded() { >Index: src/org/eclipse/core/internal/databinding/property/list/SelfListProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding.property/src/org/eclipse/core/internal/databinding/property/list/SelfListProperty.java,v >retrieving revision 1.2 >diff -u -r1.2 SelfListProperty.java >--- src/org/eclipse/core/internal/databinding/property/list/SelfListProperty.java 11 Mar 2009 21:51:48 -0000 1.2 >+++ src/org/eclipse/core/internal/databinding/property/list/SelfListProperty.java 16 Mar 2009 17:51:37 -0000 >@@ -49,11 +49,4 @@ > ISimplePropertyListener listener) { > return null; // no listener API > } >- >- protected void doAddListener(Object source, INativePropertyListener listener) { >- } >- >- protected void doRemoveListener(Object source, >- INativePropertyListener listener) { >- } > } >\ No newline at end of file >Index: src/org/eclipse/core/internal/databinding/property/map/SelfMapProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding.property/src/org/eclipse/core/internal/databinding/property/map/SelfMapProperty.java,v >retrieving revision 1.2 >diff -u -r1.2 SelfMapProperty.java >--- src/org/eclipse/core/internal/databinding/property/map/SelfMapProperty.java 11 Mar 2009 21:51:48 -0000 1.2 >+++ src/org/eclipse/core/internal/databinding/property/map/SelfMapProperty.java 16 Mar 2009 17:51:37 -0000 >@@ -56,11 +56,4 @@ > ISimplePropertyListener listener) { > return null; // no listener API > } >- >- protected void doAddListener(Object source, INativePropertyListener listener) { >- } >- >- protected void doRemoveListener(Object source, >- INativePropertyListener listener) { >- } > } >\ No newline at end of file >Index: src/org/eclipse/core/internal/databinding/property/map/SimplePropertyObservableMap.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding.property/src/org/eclipse/core/internal/databinding/property/map/SimplePropertyObservableMap.java,v >retrieving revision 1.4 >diff -u -r1.4 SimplePropertyObservableMap.java >--- src/org/eclipse/core/internal/databinding/property/map/SimplePropertyObservableMap.java 11 Mar 2009 21:51:48 -0000 1.4 >+++ src/org/eclipse/core/internal/databinding/property/map/SimplePropertyObservableMap.java 16 Mar 2009 17:51:37 -0000 >@@ -56,11 +56,26 @@ > * @param source > * @param property > */ >- public SimplePropertyObservableMap(Realm realm, Object source, >- SimpleMapProperty property) { >+ public SimplePropertyObservableMap(Realm realm, final Object source, >+ final SimpleMapProperty property) { > super(realm); > this.source = source; > this.property = property; >+ >+ Runnable typeCheck = new Runnable() { >+ public void run() { >+ try { >+ property.getMap(source); >+ } catch (RuntimeException e) { >+ dispose(); >+ throw e; >+ } >+ } >+ }; >+ if (realm.isCurrent()) >+ typeCheck.run(); >+ else >+ realm.exec(typeCheck); > } > > public Object getKeyType() { >#P org.eclipse.core.databinding >Index: src/org/eclipse/core/internal/databinding/BindingModelProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/BindingModelProperty.java,v >retrieving revision 1.2 >diff -u -r1.2 BindingModelProperty.java >--- src/org/eclipse/core/internal/databinding/BindingModelProperty.java 5 Mar 2009 19:12:09 -0000 1.2 >+++ src/org/eclipse/core/internal/databinding/BindingModelProperty.java 16 Mar 2009 17:51:38 -0000 >@@ -40,13 +40,6 @@ > return null; > } > >- protected void doAddListener(Object source, INativePropertyListener listener) { >- } >- >- protected void doRemoveListener(Object source, >- INativePropertyListener listener) { >- } >- > public String toString() { > return "Binding#model <IObservable>"; //$NON-NLS-1$ > } >Index: src/org/eclipse/core/internal/databinding/BindingTargetProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/BindingTargetProperty.java,v >retrieving revision 1.2 >diff -u -r1.2 BindingTargetProperty.java >--- src/org/eclipse/core/internal/databinding/BindingTargetProperty.java 5 Mar 2009 19:12:09 -0000 1.2 >+++ src/org/eclipse/core/internal/databinding/BindingTargetProperty.java 16 Mar 2009 17:51:38 -0000 >@@ -40,13 +40,6 @@ > return null; > } > >- protected void doAddListener(Object source, INativePropertyListener listener) { >- } >- >- protected void doRemoveListener(Object source, >- INativePropertyListener listener) { >- } >- > public String toString() { > return "Binding#target <IObservable>"; //$NON-NLS-1$ > } >Index: src/org/eclipse/core/internal/databinding/ValidationStatusProviderValidationStatusProperty.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ValidationStatusProviderValidationStatusProperty.java,v >retrieving revision 1.1 >diff -u -r1.1 ValidationStatusProviderValidationStatusProperty.java >--- src/org/eclipse/core/internal/databinding/ValidationStatusProviderValidationStatusProperty.java 7 Feb 2009 00:39:25 -0000 1.1 >+++ src/org/eclipse/core/internal/databinding/ValidationStatusProviderValidationStatusProperty.java 16 Mar 2009 17:51:38 -0000 >@@ -41,13 +41,6 @@ > return null; > } > >- protected void doAddListener(Object source, INativePropertyListener listener) { >- } >- >- protected void doRemoveListener(Object source, >- INativePropertyListener listener) { >- } >- > public String toString() { > return "ValidationStatusProvider#validationStatus <IObservableValue>"; //$NON-NLS-1$ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 262284
: 128961 |
128962
|
128999
|
129000
|
129001
|
129002