[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] [Created] (XMLBEANS-469) ElementImpl.getMinOccurs() causes
From:       "Peter Fielding (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2011-09-08 20:30:09
Message-ID: 685976103.4821.1315513809180.JavaMail.tomcat () hel ! zones ! apache ! org
[Download RAW message or body]

ElementImpl.getMinOccurs() causes XmlValueNotSupportedException
---------------------------------------------------------------

                 Key: XMLBEANS-469
                 URL: https://issues.apache.org/jira/browse/XMLBEANS-469
             Project: XMLBeans
          Issue Type: Bug
          Components: XmlObject
    Affects Versions: Version 2.4 
         Environment: Linux
            Reporter: Peter Fielding


This code:

if (elem.isSetMaxOccurs()) {
  Object o = elem.getMinOccurs();

  if (o instanceof Number) {
    myElem.setMinOccurs(((Number) o).intValue());
  }
}

causes this exception:

org.apache.xmlbeans.impl.values.XmlValueNotSupportedException: Could not get a Java \
                numeric type from a Schema unknown type
        at org.apache.xmlbeans.impl.values.XmlObjectBase.getBigDecimalValue(XmlObjectBase.java:1392)
                
        at org.apache.xmlbeans.impl.values.XmlObjectBase.bigDecimalValue(XmlObjectBase.java:1545)
                
        at org.apache.xmlbeans.impl.values.XmlObjectBase.getBigIntegerValue(XmlObjectBase.java:1397)
                
        at org.apache.xmlbeans.impl.xb.xsdschema.impl.ElementImpl.getMinOccurs(ElementImpl.java:942)


in line 2, where elem.getMinOccurs() is called. A similar code for maxOccurs works \
just fine. Exception will be thrown as soon as minOccurs is set to a random positive \
integer value in the XSD file (e.g. 1, 5 and so on).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic