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 to...@apache.org on 2004/11/18 22:37:34 UTC

cvs commit: ws-axis/java/src/org/apache/axis/encoding/ser ArrayDeserializer.java ArraySerializer.java

tomj        2004/11/18 13:37:34

  Modified:    java/src/org/apache/axis/encoding/ser ArrayDeserializer.java
                        ArraySerializer.java
  Log:
  Fix .NET 2D array interop problem caused by previous changes.
  
  Update the array serializer to not add the subdimentions to the array if
  the component type is set as we will already have them there.
  
  Back out my change to the Deserializer that compensates for the incorrect
  serialization.
  
  Revision  Changes    Path
  1.46      +1 -8      ws-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java
  
  Index: ArrayDeserializer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- ArrayDeserializer.java	18 Nov 2004 15:26:15 -0000	1.45
  +++ ArrayDeserializer.java	18 Nov 2004 21:37:34 -0000	1.46
  @@ -239,8 +239,6 @@
                           offset ++;
                       }
                   } else {
  -                    // This might not be right because the arrayItemClass below
  -                    // is going to have dimensions too..
                       dims += innerDimString;
               }
           }
  @@ -248,13 +246,8 @@
           arrayItemClass = context.getTypeMapping().getClassForQName(compQName);
           if (arrayItemClass != null) {
               try {
  -                final String name = arrayItemClass.getName();
  -                if (name.indexOf('[') != -1) {
  -                    // Just add a single dimension
  -                    dims = "[]";
  -                }
                   String loadableArrayClassName = JavaUtils.getLoadableClassName(
  -                                                    JavaUtils.getTextClassName(name) + dims);
  +                                                    JavaUtils.getTextClassName(arrayItemClass.getName()) + dims);
                   arrayClass = ClassUtils.forName(loadableArrayClassName,
                                                       true,
                                                       arrayItemClass.getClassLoader());
  
  
  
  1.61      +7 -3      ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java
  
  Index: ArraySerializer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- ArraySerializer.java	18 Nov 2004 15:26:15 -0000	1.60
  +++ ArraySerializer.java	18 Nov 2004 21:37:34 -0000	1.61
  @@ -179,10 +179,14 @@
           String arrayType = "";
           int dim2Len = -1;
           if (encoded) {
  -            if (soap == SOAPConstants.SOAP12_CONSTANTS)
  +            if (soap == SOAPConstants.SOAP12_CONSTANTS) {
                   arrayType = dims + len;
  -            else
  -                arrayType = dims + "[" + len + "]";
  +            } else {
  +                if (componentType == null)
  +                    arrayType = dims + "[" + len + "]";
  +                else
  +                    arrayType = "[" + len + "]";
  +            }
   
               // Discover whether array can be serialized directly as a two-dimensional
               // array (i.e. arrayType=int[2,3]) versus an array of arrays.