Nulls for fields in generated classes not handled properly
----------------------------------------------------------

         Key: AXIS2-538
         URL: http://issues.apache.org/jira/browse/AXIS2-538
     Project: Apache Axis 2.0 (Axis2)
        Type: Bug
  Components: databinding  
    Versions: 0.95    
    Reporter: Dmitriy Kiriy
    Priority: Blocker


If I have in XML Schema

<xsd:element name="SomeDate" type="xsd:date" />

it mean that minOccurs="0" (from XML Schema specification)

but generated code not handling case that field can be setted up as null:

if (localSomeDateTracker){
                             elementList.add(new 
javax.xml.namespace.QName("http://mycompany.com/schema/data";,
                                                                      
"SomeDate"));
                            
                                elementList.add(
                                   
org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSomeDate));
                                } 

Should be something: 

if (localSomeDateTracker && localSomeDate!= null && notRequired){
                             elementList.add(new 
javax.xml.namespace.QName("http://mycompany.com/schema/data";,
                                                                      
"SomeDate"));
                            
                                elementList.add(
                                   
org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSomeDate));
                                } else {
    throw new Exception("Field SomeDate for entity Someentity required but 
null");
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to