Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sapphire-dev] Exception

Fixed. The problem was with the xml binding annotation on the Name property of IValuePropertyActionsGalleryEntity.

 

Original: @XmlBinding( path = "" )

Fix: @XmlValueBinding( path = "", removeNodeOnSetIfNull = false )

 

What’s going on is that default xml value binding will remove bound XML node when the property is set to null. This is generally appropriate, but in this case the property is bound to the same XML element as its parent model element (path="" specification). Removing the xml element causes havoc for the parent model element.

 

I think there is a case for making xml binding smarter in this case to avoid this problem in the first place. Opened a bug to track that:

 

https://bugs.eclipse.org/bugs/show_bug.cgi?id=330038

 

- Konstantin

 

 

From: Ling Hao [mailto:ling.hao@xxxxxxxxxx]
Sent: Thursday, November 11, 2010 11:01 AM
To: Konstantin Komissarchik
Subject: RE: Exception

 

I'm seeing the same exception in

 

1. sapphire-gallery.xml -> Actions

2. add a name

3. edit the name and clear the content and get the same exception.

 

I saw you change in IValuePropertyActionsGalleryReference, but am not sure how to fix this one. (Been staring at this all morning, and nothing..)

 


From: Konstantin Komissarchik
Sent: Tuesday, November 02, 2010 10:29 AM
To: Ling Hao
Cc: Sapphire project
Subject: RE: Exception

Just checked in a fix.

 

- Konstantin

 

 

From: Ling Hao [mailto:ling.hao@xxxxxxxxxx]
Sent: Monday, November 01, 2010 5:02 PM
To: Konstantin Komissarchik
Subject: Exception

 

I was playing with the lists and found this exception. Is this a known issue? If not, I'll take a look before the other bug.

 

1. sapphire-gallery.xml -> List property editor

2. add a reference

3. edit the reference and clear the content and get the following exception.

 

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

at java.util.ArrayList.RangeCheck(ArrayList.java:547)

at java.util.ArrayList.get(ArrayList.java:322)

at org.eclipse.sapphire.modeling.xml.XmlPath.getSegment(XmlPath.java:97)

at org.eclipse.sapphire.modeling.xml.XmlElement.removeChildNode(XmlElement.java:797)

at org.eclipse.sapphire.modeling.xml.XmlElement.removeChildNode(XmlElement.java:788)

at org.eclipse.sapphire.modeling.xml.XmlElement.setChildNodeText(XmlElement.java:771)

at org.eclipse.sapphire.modeling.xml.StandardXmlValueBindingImpl.write(StandardXmlValueBindingImpl.java:161)


Back to the top