Hello all,
When you have an abstract element in your schema, like this:
<xs:complexType abstract="true" name="Tabstractheader">
<xs:sequence>
<xs:element name="username" type="xs:string" minOccurs="1"
maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Trequestheader">
<xs:complexContent>
<xs:extension base="ah:Tabstractheader">
<xs:sequence>
<xs:element name="password" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">general
password</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Tresponseheader">
<xs:complexContent>
<xs:extension base="ah:Tabstractheader"/>
</xs:complexContent>
</xs:complexType>
the generated abstract class contains also a factory and the parse method.
During compiling you get this warning:
Null pointer access: The variable object can only be null at this location
And the generated code is:
public static Tabstractheader parse(javax.xml.stream.XMLStreamReader reader)
throws java.lang.Exception{
Tabstractheader object =
null;
// and so on
object.setUsername(
org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
// and so on
}
I know the code would never be called from axis but a user can try to call
it. for example like this: Tabstractheader.Factory.parse(.......)
Isn't it better that the complete Factory will not be generated?
regards alex