Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Possible errors in the XSD facet item providers
Possible errors in the XSD facet item providers [message #36062] Fri, 16 January 2004 16:48 Go to next message
Dennis Fuglsang is currently offline Dennis FuglsangFriend
Messages: 77
Registered: July 2009
Member
Ed,

I have been diagnosing a problem associated with the "Value" EAttribute on
XSD facets via the Eclipse properties view. The problem ultimately stems
from calling the XSD facet's eIsSet method with the wrong EStructuralFeature
reference resulting in the following exception

java.lang.IllegalArgumentException: The feature 'value' is not a valid
feature
at
org.eclipse.emf.ecore.impl.EObjectImpl.eDynamicIsSet(EObject Impl.java:480)
at
org.eclipse.xsd.impl.XSDMinLengthFacetImpl.eIsSet(XSDMinLeng thFacetImpl.java
:305)
at
org.eclipse.emf.edit.provider.ItemPropertyDescriptor.getProp ertyValue(ItemPr
opertyDescriptor.java:658)
at
org.eclipse.emf.edit.ui.provider.PropertySource.getPropertyV alue(PropertySou
rce.java:95)
at
com.metamatrix.modeler.internal.ui.properties.ModelObjectPro pertySource.getP
ropertyValue(ModelObjectPropertySource.java:224)
at
org.eclipse.ui.views.properties.PropertySheetEntry.refreshVa lues(PropertyShe
etEntry.java:489)
at
org.eclipse.ui.views.properties.PropertySheetEntry.refreshCh ildEntries(Prope
rtySheetEntry.java:455)
at
org.eclipse.ui.views.properties.PropertySheetEntry.setValues (PropertySheetEn
try.java:611)
at
org.eclipse.ui.views.properties.PropertySheetViewer.setInput (PropertySheetVi
ewer.java:776)
at
org.eclipse.ui.views.properties.PropertySheetPage.selectionC hanged(PropertyS
heetPage.java:377)


As I have been tracking through this is seems that the PropertyDescriptor
for the "Value" feature is not constructed with the correct
EStructuralFeature reference. For example, for an XSDMinLengthFacet the
logic shown below uses the XSDMinFacet's EStructuralFeature reference
instead of the one for XSDMinLengthFacet. Is this an error ?

The logic in XSDMinLengthFacetItemProvider ...
public List getPropertyDescriptors(Object object)
{
if (itemPropertyDescriptors == null)
{
super.getPropertyDescriptors(object);

XSDMinLengthFacet xsdMinLengthFacet = ((XSDMinLengthFacet)object);

// This is for the value feature.
//
itemPropertyDescriptors.add
(new ItemPropertyDescriptor

(((ComposeableAdapterFactory)adapterFactory).getRootAdapterF actory(),
XSDEditPlugin.getString("_UI_Value_label"),
XSDEditPlugin.getString("_UI_ValueMinLengthFacet_description "),
xsdPackage.getXSDMinFacet_Value(), <==== FIX ???? Should this
be xsdPackage.getXSDMinLengthFacet_Value(),
true,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE));

}
return itemPropertyDescriptors;
}
Re: Possible errors in the XSD facet item providers [message #36099 is a reply to message #36062] Fri, 16 January 2004 17:25 Go to previous messageGo to next message
Frank Budinsky is currently offline Frank BudinskyFriend
Messages: 478
Registered: July 2009
Senior Member
Hi Dennis,

Ed is on vacation until next Wednesday.

I think you are right about the bug. It looks like a copy/modify error from when
the code was written (the XSD item providers predate the EMF.Edit code
generator, so they were coded by hand). I noticed the same thing in several
other classes (e.g., XSDMaxLengthFacetItemProvider).

Did you try to make the change, to see if it works then? Do you know why this
doesn't show up in the XSD Sample Editor? Does it never display these item
providers?

Could you please open a bugzilla defect for this.

Thanks,
Frank.


dfuglsang wrote:

> Ed,
>
> I have been diagnosing a problem associated with the "Value" EAttribute on
> XSD facets via the Eclipse properties view. The problem ultimately stems
> from calling the XSD facet's eIsSet method with the wrong EStructuralFeature
> reference resulting in the following exception
>
> java.lang.IllegalArgumentException: The feature 'value' is not a valid
> feature
> at
> org.eclipse.emf.ecore.impl.EObjectImpl.eDynamicIsSet(EObject Impl.java:480)
> at
> org.eclipse.xsd.impl.XSDMinLengthFacetImpl.eIsSet(XSDMinLeng thFacetImpl.java
> :305)
> at
> org.eclipse.emf.edit.provider.ItemPropertyDescriptor.getProp ertyValue(ItemPr
> opertyDescriptor.java:658)
> at
> org.eclipse.emf.edit.ui.provider.PropertySource.getPropertyV alue(PropertySou
> rce.java:95)
> at
> com.metamatrix.modeler.internal.ui.properties.ModelObjectPro pertySource.getP
> ropertyValue(ModelObjectPropertySource.java:224)
> at
> org.eclipse.ui.views.properties.PropertySheetEntry.refreshVa lues(PropertyShe
> etEntry.java:489)
> at
> org.eclipse.ui.views.properties.PropertySheetEntry.refreshCh ildEntries(Prope
> rtySheetEntry.java:455)
> at
> org.eclipse.ui.views.properties.PropertySheetEntry.setValues (PropertySheetEn
> try.java:611)
> at
> org.eclipse.ui.views.properties.PropertySheetViewer.setInput (PropertySheetVi
> ewer.java:776)
> at
> org.eclipse.ui.views.properties.PropertySheetPage.selectionC hanged(PropertyS
> heetPage.java:377)
>
> As I have been tracking through this is seems that the PropertyDescriptor
> for the "Value" feature is not constructed with the correct
> EStructuralFeature reference. For example, for an XSDMinLengthFacet the
> logic shown below uses the XSDMinFacet's EStructuralFeature reference
> instead of the one for XSDMinLengthFacet. Is this an error ?
>
> The logic in XSDMinLengthFacetItemProvider ...
> public List getPropertyDescriptors(Object object)
> {
> if (itemPropertyDescriptors == null)
> {
> super.getPropertyDescriptors(object);
>
> XSDMinLengthFacet xsdMinLengthFacet = ((XSDMinLengthFacet)object);
>
> // This is for the value feature.
> //
> itemPropertyDescriptors.add
> (new ItemPropertyDescriptor
>
> (((ComposeableAdapterFactory)adapterFactory).getRootAdapterF actory(),
> XSDEditPlugin.getString("_UI_Value_label"),
> XSDEditPlugin.getString("_UI_ValueMinLengthFacet_description "),
> xsdPackage.getXSDMinFacet_Value(), <==== FIX ???? Should this
> be xsdPackage.getXSDMinLengthFacet_Value(),
> true,
> ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE));
>
> }
> return itemPropertyDescriptors;
> }
Re: Possible errors in the XSD facet item providers [message #36302 is a reply to message #36099] Mon, 19 January 2004 16:42 Go to previous message
Dennis Fuglsang is currently offline Dennis FuglsangFriend
Messages: 77
Registered: July 2009
Member
Frank,

I ended up creating a local patch for the xsd.edit code, specifically the
XSDMaxLengthFacetItemProvider and XSDMinLengthFacetItemProvider classes.
Those two classes, I believe, are the only item providers with the error in
the getPropertyDefinitions(Object) method. Frank, you and Ed may want to
check the other xsd item providers to verify the problem is confined to only
those two classes but my patch does seem to fix the problems I have had
working with facets. (bugzilla defect #50222)

Thanks for your help,

Dennis

"Frank Budinsky" <frankb@ca.ibm.com> wrote in message
news:40081EA4.DCCFF172@ca.ibm.com...
> Hi Dennis,
>
> Ed is on vacation until next Wednesday.
>
> I think you are right about the bug. It looks like a copy/modify error
from when
> the code was written (the XSD item providers predate the EMF.Edit code
> generator, so they were coded by hand). I noticed the same thing in
several
> other classes (e.g., XSDMaxLengthFacetItemProvider).
>
> Did you try to make the change, to see if it works then? Do you know why
this
> doesn't show up in the XSD Sample Editor? Does it never display these item
> providers?
>
> Could you please open a bugzilla defect for this.
>
> Thanks,
> Frank.
>
>
> dfuglsang wrote:
>
> > Ed,
> >
> > I have been diagnosing a problem associated with the "Value" EAttribute
on
> > XSD facets via the Eclipse properties view. The problem ultimately
stems
> > from calling the XSD facet's eIsSet method with the wrong
EStructuralFeature
> > reference resulting in the following exception
> >
> > java.lang.IllegalArgumentException: The feature 'value' is not a valid
> > feature
> > at
> >
org.eclipse.emf.ecore.impl.EObjectImpl.eDynamicIsSet(EObject Impl.java:480)
> > at
> >
org.eclipse.xsd.impl.XSDMinLengthFacetImpl.eIsSet(XSDMinLeng thFacetImpl.java
> > :305)
> > at
> >
org.eclipse.emf.edit.provider.ItemPropertyDescriptor.getProp ertyValue(ItemPr
> > opertyDescriptor.java:658)
> > at
> >
org.eclipse.emf.edit.ui.provider.PropertySource.getPropertyV alue(PropertySou
> > rce.java:95)
> > at
> >
com.metamatrix.modeler.internal.ui.properties.ModelObjectPro pertySource.getP
> > ropertyValue(ModelObjectPropertySource.java:224)
> > at
> >
org.eclipse.ui.views.properties.PropertySheetEntry.refreshVa lues(PropertyShe
> > etEntry.java:489)
> > at
> >
org.eclipse.ui.views.properties.PropertySheetEntry.refreshCh ildEntries(Prope
> > rtySheetEntry.java:455)
> > at
> >
org.eclipse.ui.views.properties.PropertySheetEntry.setValues (PropertySheetEn
> > try.java:611)
> > at
> >
org.eclipse.ui.views.properties.PropertySheetViewer.setInput (PropertySheetVi
> > ewer.java:776)
> > at
> >
org.eclipse.ui.views.properties.PropertySheetPage.selectionC hanged(PropertyS
> > heetPage.java:377)
> >
> > As I have been tracking through this is seems that the
PropertyDescriptor
> > for the "Value" feature is not constructed with the correct
> > EStructuralFeature reference. For example, for an XSDMinLengthFacet the
> > logic shown below uses the XSDMinFacet's EStructuralFeature reference
> > instead of the one for XSDMinLengthFacet. Is this an error ?
> >
> > The logic in XSDMinLengthFacetItemProvider ...
> > public List getPropertyDescriptors(Object object)
> > {
> > if (itemPropertyDescriptors == null)
> > {
> > super.getPropertyDescriptors(object);
> >
> > XSDMinLengthFacet xsdMinLengthFacet = ((XSDMinLengthFacet)object);
> >
> > // This is for the value feature.
> > //
> > itemPropertyDescriptors.add
> > (new ItemPropertyDescriptor
> >
> > (((ComposeableAdapterFactory)adapterFactory).getRootAdapterF actory(),
> > XSDEditPlugin.getString("_UI_Value_label"),
> >
XSDEditPlugin.getString("_UI_ValueMinLengthFacet_description "),
> > xsdPackage.getXSDMinFacet_Value(), <==== FIX ???? Should
this
> > be xsdPackage.getXSDMinLengthFacet_Value(),
> > true,
> > ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE));
> >
> > }
> > return itemPropertyDescriptors;
> > }
>
Re: Possible errors in the XSD facet item providers [message #582851 is a reply to message #36062] Fri, 16 January 2004 17:25 Go to previous message
Frank Budinsky is currently offline Frank BudinskyFriend
Messages: 478
Registered: July 2009
Senior Member
Hi Dennis,

Ed is on vacation until next Wednesday.

I think you are right about the bug. It looks like a copy/modify error from when
the code was written (the XSD item providers predate the EMF.Edit code
generator, so they were coded by hand). I noticed the same thing in several
other classes (e.g., XSDMaxLengthFacetItemProvider).

Did you try to make the change, to see if it works then? Do you know why this
doesn't show up in the XSD Sample Editor? Does it never display these item
providers?

Could you please open a bugzilla defect for this.

Thanks,
Frank.


dfuglsang wrote:

> Ed,
>
> I have been diagnosing a problem associated with the "Value" EAttribute on
> XSD facets via the Eclipse properties view. The problem ultimately stems
> from calling the XSD facet's eIsSet method with the wrong EStructuralFeature
> reference resulting in the following exception
>
> java.lang.IllegalArgumentException: The feature 'value' is not a valid
> feature
> at
> org.eclipse.emf.ecore.impl.EObjectImpl.eDynamicIsSet(EObject Impl.java:480)
> at
> org.eclipse.xsd.impl.XSDMinLengthFacetImpl.eIsSet(XSDMinLeng thFacetImpl.java
> :305)
> at
> org.eclipse.emf.edit.provider.ItemPropertyDescriptor.getProp ertyValue(ItemPr
> opertyDescriptor.java:658)
> at
> org.eclipse.emf.edit.ui.provider.PropertySource.getPropertyV alue(PropertySou
> rce.java:95)
> at
> com.metamatrix.modeler.internal.ui.properties.ModelObjectPro pertySource.getP
> ropertyValue(ModelObjectPropertySource.java:224)
> at
> org.eclipse.ui.views.properties.PropertySheetEntry.refreshVa lues(PropertyShe
> etEntry.java:489)
> at
> org.eclipse.ui.views.properties.PropertySheetEntry.refreshCh ildEntries(Prope
> rtySheetEntry.java:455)
> at
> org.eclipse.ui.views.properties.PropertySheetEntry.setValues (PropertySheetEn
> try.java:611)
> at
> org.eclipse.ui.views.properties.PropertySheetViewer.setInput (PropertySheetVi
> ewer.java:776)
> at
> org.eclipse.ui.views.properties.PropertySheetPage.selectionC hanged(PropertyS
> heetPage.java:377)
>
> As I have been tracking through this is seems that the PropertyDescriptor
> for the "Value" feature is not constructed with the correct
> EStructuralFeature reference. For example, for an XSDMinLengthFacet the
> logic shown below uses the XSDMinFacet's EStructuralFeature reference
> instead of the one for XSDMinLengthFacet. Is this an error ?
>
> The logic in XSDMinLengthFacetItemProvider ...
> public List getPropertyDescriptors(Object object)
> {
> if (itemPropertyDescriptors == null)
> {
> super.getPropertyDescriptors(object);
>
> XSDMinLengthFacet xsdMinLengthFacet = ((XSDMinLengthFacet)object);
>
> // This is for the value feature.
> //
> itemPropertyDescriptors.add
> (new ItemPropertyDescriptor
>
> (((ComposeableAdapterFactory)adapterFactory).getRootAdapterF actory(),
> XSDEditPlugin.getString("_UI_Value_label"),
> XSDEditPlugin.getString("_UI_ValueMinLengthFacet_description "),
> xsdPackage.getXSDMinFacet_Value(), <==== FIX ???? Should this
> be xsdPackage.getXSDMinLengthFacet_Value(),
> true,
> ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE));
>
> }
> return itemPropertyDescriptors;
> }
Re: Possible errors in the XSD facet item providers [message #582977 is a reply to message #36099] Mon, 19 January 2004 16:42 Go to previous message
Dennis Fuglsang is currently offline Dennis FuglsangFriend
Messages: 77
Registered: July 2009
Member
Frank,

I ended up creating a local patch for the xsd.edit code, specifically the
XSDMaxLengthFacetItemProvider and XSDMinLengthFacetItemProvider classes.
Those two classes, I believe, are the only item providers with the error in
the getPropertyDefinitions(Object) method. Frank, you and Ed may want to
check the other xsd item providers to verify the problem is confined to only
those two classes but my patch does seem to fix the problems I have had
working with facets. (bugzilla defect #50222)

Thanks for your help,

Dennis

"Frank Budinsky" <frankb@ca.ibm.com> wrote in message
news:40081EA4.DCCFF172@ca.ibm.com...
> Hi Dennis,
>
> Ed is on vacation until next Wednesday.
>
> I think you are right about the bug. It looks like a copy/modify error
from when
> the code was written (the XSD item providers predate the EMF.Edit code
> generator, so they were coded by hand). I noticed the same thing in
several
> other classes (e.g., XSDMaxLengthFacetItemProvider).
>
> Did you try to make the change, to see if it works then? Do you know why
this
> doesn't show up in the XSD Sample Editor? Does it never display these item
> providers?
>
> Could you please open a bugzilla defect for this.
>
> Thanks,
> Frank.
>
>
> dfuglsang wrote:
>
> > Ed,
> >
> > I have been diagnosing a problem associated with the "Value" EAttribute
on
> > XSD facets via the Eclipse properties view. The problem ultimately
stems
> > from calling the XSD facet's eIsSet method with the wrong
EStructuralFeature
> > reference resulting in the following exception
> >
> > java.lang.IllegalArgumentException: The feature 'value' is not a valid
> > feature
> > at
> >
org.eclipse.emf.ecore.impl.EObjectImpl.eDynamicIsSet(EObject Impl.java:480)
> > at
> >
org.eclipse.xsd.impl.XSDMinLengthFacetImpl.eIsSet(XSDMinLeng thFacetImpl.java
> > :305)
> > at
> >
org.eclipse.emf.edit.provider.ItemPropertyDescriptor.getProp ertyValue(ItemPr
> > opertyDescriptor.java:658)
> > at
> >
org.eclipse.emf.edit.ui.provider.PropertySource.getPropertyV alue(PropertySou
> > rce.java:95)
> > at
> >
com.metamatrix.modeler.internal.ui.properties.ModelObjectPro pertySource.getP
> > ropertyValue(ModelObjectPropertySource.java:224)
> > at
> >
org.eclipse.ui.views.properties.PropertySheetEntry.refreshVa lues(PropertyShe
> > etEntry.java:489)
> > at
> >
org.eclipse.ui.views.properties.PropertySheetEntry.refreshCh ildEntries(Prope
> > rtySheetEntry.java:455)
> > at
> >
org.eclipse.ui.views.properties.PropertySheetEntry.setValues (PropertySheetEn
> > try.java:611)
> > at
> >
org.eclipse.ui.views.properties.PropertySheetViewer.setInput (PropertySheetVi
> > ewer.java:776)
> > at
> >
org.eclipse.ui.views.properties.PropertySheetPage.selectionC hanged(PropertyS
> > heetPage.java:377)
> >
> > As I have been tracking through this is seems that the
PropertyDescriptor
> > for the "Value" feature is not constructed with the correct
> > EStructuralFeature reference. For example, for an XSDMinLengthFacet the
> > logic shown below uses the XSDMinFacet's EStructuralFeature reference
> > instead of the one for XSDMinLengthFacet. Is this an error ?
> >
> > The logic in XSDMinLengthFacetItemProvider ...
> > public List getPropertyDescriptors(Object object)
> > {
> > if (itemPropertyDescriptors == null)
> > {
> > super.getPropertyDescriptors(object);
> >
> > XSDMinLengthFacet xsdMinLengthFacet = ((XSDMinLengthFacet)object);
> >
> > // This is for the value feature.
> > //
> > itemPropertyDescriptors.add
> > (new ItemPropertyDescriptor
> >
> > (((ComposeableAdapterFactory)adapterFactory).getRootAdapterF actory(),
> > XSDEditPlugin.getString("_UI_Value_label"),
> >
XSDEditPlugin.getString("_UI_ValueMinLengthFacet_description "),
> > xsdPackage.getXSDMinFacet_Value(), <==== FIX ???? Should
this
> > be xsdPackage.getXSDMinLengthFacet_Value(),
> > true,
> > ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE));
> >
> > }
> > return itemPropertyDescriptors;
> > }
>
Previous Topic:xmleditor
Next Topic:Creating XSDAnnotations
Goto Forum:
  


Current Time: Fri Apr 26 08:42:44 GMT 2024

Powered by FUDForum. Page generated in 0.03995 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top