jmsnell 2003/02/20 14:43:52
Modified: java/src/org/apache/axis/description TypeDesc.java
Log:
FIX http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17188
Added a null check before attempting to copy parent fields into a subclassed types
description.
The getFields method was returning null when the base XML Schema element didn't
contain any
elements or attributes.
Revision Changes Path
1.27 +8 -4 xml-axis/java/src/org/apache/axis/description/TypeDesc.java
Index: TypeDesc.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/TypeDesc.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- TypeDesc.java 19 Feb 2003 21:25:33 -0000 1.26
+++ TypeDesc.java 20 Feb 2003 22:43:52 -0000 1.27
@@ -188,10 +188,14 @@
TypeDesc superDesc = getTypeDescForClass(cls);
if (superDesc != null) {
FieldDesc [] parentFields = superDesc.getFields(true);
- FieldDesc [] ret = new FieldDesc[parentFields.length +
fields.length];
- System.arraycopy(parentFields, 0, ret, 0, parentFields.length);
- System.arraycopy(fields, 0, ret, parentFields.length,
fields.length);
- fields = ret;
+// START FIX http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17188
+ if (parentFields != null) {
+ FieldDesc [] ret = new FieldDesc[parentFields.length +
fields.length];
+ System.arraycopy(parentFields, 0, ret, 0,
parentFields.length);
+ System.arraycopy(fields, 0, ret, parentFields.length,
fields.length);
+ fields = ret;
+ }
+// END FIX http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17188
}
}
}