NPE in SchemaBuilder when appinfo element of annotation empty
-------------------------------------------------------------

         Key: WSCOMMONS-49
         URL: http://issues.apache.org/jira/browse/WSCOMMONS-49
     Project: WS-Commons
        Type: Bug

  Components: XmlSchema  
 Environment: Windows XP SP2
    Reporter: Brent Ulbricht


If the appinfo element does not include a source attribute and does not have 
any content
a NullPointerException occurs.

  <simpleType name="emptyAppinfo">
    <annotation>
      <documentation source="http://test/source/doc"; 
xml:lang="en">testing987</documentation>
      <appinfo/>
    </annotation>
    <restriction base="string">
      <length value="1"/>
    </restriction>
  </simpleType>

        java.lang.NullPointerException
        at 
org.apache.ws.commons.schema.SchemaBuilder.handleAppInfo(SchemaBuilder.java:1864)
        at 
org.apache.ws.commons.schema.SchemaBuilder.handleAnnotation(SchemaBuilder.java:1838)
        at 
org.apache.ws.commons.schema.SchemaBuilder.handleSimpleType(SchemaBuilder.java:334)
        at 
org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:109)
        at 
org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:53)
        at 
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:268)
        at 
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:230)
        at 
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:250)
        at tests.AnnotationTest.testEmptyAppInfo(AnnotationTest.java:74)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

The documentation element (handleDocumentation method) in SchemaBuilder has 
logic to protect against this by checking if the
markup variable is 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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to