You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2001/09/17 22:44:58 UTC

cvs commit: xml-axis/java/src/org/apache/axis/encoding ArraySerializer.java

gdaniels    01/09/17 13:44:58

  Modified:    java/src/org/apache/axis/encoding ArraySerializer.java
  Log:
  Deal with deserializing null arrays, and fix a bug when serializing
  empty arrays.
  
  Revision  Changes    Path
  1.16      +10 -2     xml-axis/java/src/org/apache/axis/encoding/ArraySerializer.java
  
  Index: ArraySerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ArraySerializer.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ArraySerializer.java	2001/08/09 15:05:38	1.15
  +++ ArraySerializer.java	2001/09/17 20:44:58	1.16
  @@ -110,7 +110,11 @@
           if (DEBUG_LOG) {
               System.err.println("In ArraySerializer.startElement()");
           }
  -        
  +
  +        if (attributes.getValue(Constants.URI_CURRENT_SCHEMA_XSI,  "nil") != null) {
  +            return;
  +        }
  +
           QName arrayTypeValue = context.getQNameFromString(
                                     attributes.getValue(Constants.URI_SOAP_ENC,
                                                      Constants.ATTR_ARRAY_TYPE));
  @@ -284,7 +288,11 @@
           if (list == null) {
               componentType = cls.getComponentType();
           } else {
  -            componentType = list.get(0).getClass();
  +            if (list.isEmpty()) {
  +                componentType = Object.class;
  +            } else {
  +                componentType = list.get(0).getClass();
  +            }
           }
           
           QName componentQName = context.getQNameForClass(componentType);