axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jongjinc...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/utils ArrayUtil.java JavaUtils.java
Date Wed, 23 Mar 2005 02:22:41 GMT
jongjinchoi    2005/03/22 18:22:41

  Modified:    java/src/org/apache/axis/utils ArrayUtil.java JavaUtils.java
  Log:
  separate NUll and non-covertable in ArrayOfT --> T[] conversion
  
  Revision  Changes    Path
  1.3       +10 -3     ws-axis/java/src/org/apache/axis/utils/ArrayUtil.java
  
  Index: ArrayUtil.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/utils/ArrayUtil.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ArrayUtil.java	21 Mar 2005 15:00:40 -0000	1.2
  +++ ArrayUtil.java	23 Mar 2005 02:22:41 -0000	1.3
  @@ -26,6 +26,13 @@
           public int dimension;       
       }
           
  +    public static class NonConvertable {
  +        public NonConvertable() { }            
  +    }
  +    
  +    /** An object indicating that the conversion is not possible */
  +    public static final NonConvertable NON_CONVERTABLE = new NonConvertable();
  +    
       /**
        * Convert ArrayOfT to T[].
        * @param obj        the object of type ArrayOfT to convert
  @@ -45,9 +52,9 @@
               BeanPropertyDescriptor pd = null;                   
               pd = getArrayComponentPD(obj.getClass());           
               if (pd == null) {
  -                return null;
  +                return NON_CONVERTABLE;
               }
  -            Object comp = pd.get(obj);              
  +            Object comp = pd.get(obj);
               if (comp == null) {
                   return null;
               }
  @@ -156,7 +163,7 @@
                   }
               }
               cls = cls.getSuperclass();
  -        }           
  +        }
           
           if (count == 1) {
               return bpd;
  
  
  
  1.117     +4 -2      ws-axis/java/src/org/apache/axis/utils/JavaUtils.java
  
  Index: JavaUtils.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/utils/JavaUtils.java,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- JavaUtils.java	21 Mar 2005 15:00:40 -0000	1.116
  +++ JavaUtils.java	23 Mar 2005 02:22:41 -0000	1.117
  @@ -316,10 +316,12 @@
           // in case destClass is array and arg is ArrayOfT class. (ArrayOfT -> T[])
           if (arg != null && destClass.isArray()) {
               Object newArg = ArrayUtil.convertObjectToArray(arg, destClass);           

  -            if (!newArg.getClass().getName().equals(arg.getClass().getName())) 
  +            if (newArg == null 
  +                    || (newArg != ArrayUtil.NON_CONVERTABLE && newArg != arg))
{
                   return newArg;
  +            }            
           }
  -       
  +               
           // in case arg is ArrayOfT and destClass is an array. (T[] -> ArrayOfT)
           if (arg != null && arg.getClass().isArray()) {			
               Object newArg = ArrayUtil.convertArrayToObject(arg, destClass);
  
  
  

Mime
View raw message