xmlbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Campolongo (JIRA)" <xmlbeans-...@xml.apache.org>
Subject [jira] Created: (XMLBEANS-317) setXXX(null) on a nil element leaves bean in invalid state
Date Fri, 02 Mar 2007 21:51:50 GMT
setXXX(null) on a nil element leaves bean in invalid state
----------------------------------------------------------

                 Key: XMLBEANS-317
                 URL: https://issues.apache.org/jira/browse/XMLBEANS-317
             Project: XMLBeans
          Issue Type: Bug
          Components: XmlObject
    Affects Versions: Version 2.2
         Environment: Java_1.5.0_10 on Windows2000
            Reporter: Joseph Campolongo


Given the following schema

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="unqualified" attributeFormDefault="unqualified">

    <xs:element name="TestSet">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Name" type="xs:string"/>
        <xs:element name="More">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="MoreName" type="xs:string"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

the following code will fail if assertions are enabled:

    TestSetDocument doc = TestSetDocument.Factory.newInstance();
    TestSet testSet = doc.addNewTestSet();

    testSet.setMore(null);
    testSet.setMore(null);
    testSet.validate();

while it will succeed if assertions are disabled.

The exception is

      at org.apache.xmlbeans.impl.values.XmlObjectBase.build_text(XmlObjectBase.java:837)
      at org.apache.xmlbeans.impl.store.Xobj.ensureOccupancy(Xobj.java:1694)
      at org.apache.xmlbeans.impl.store.Cur.next(Cur.java:1444)
      at org.apache.xmlbeans.impl.store.Validate.process(Validate.java:74)
      at org.apache.xmlbeans.impl.store.Validate.<init>(Validate.java:39)
      at org.apache.xmlbeans.impl.store.Xobj.validate(Xobj.java:1860)
      at org.apache.xmlbeans.impl.values.XmlObjectBase.validate(XmlObjectBase.java:343)

I will attach a test case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


Mime
View raw message