axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/encoding SerializationContext.java
Date Thu, 02 Aug 2001 12:45:37 GMT
rubys       01/08/02 05:45:37

  Modified:    java/src/org/apache/axis/encoding SerializationContext.java
  Log:
  Only use multi-ref when there is a possibility of circularity
  
  Revision  Changes    Path
  1.24      +12 -9     xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java
  
  Index: SerializationContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- SerializationContext.java	2001/07/30 15:33:53	1.23
  +++ SerializationContext.java	2001/08/02 12:45:37	1.24
  @@ -195,18 +195,21 @@
       }
       
       /**
  -     * Classes which are known to not require multi-ref.  Doing multiref
  -     * for these would not only tend to increase the size of the payload,
  -     * they decrease interopability by utilizing an advanced function of
  -     * the protocol unnecessarily.
  +     * Classes which are known to not require multi-ref.  As multi-ref
  +     * requires additional parsing overhead and not all implementations
  +     * support this, only use this function when there is a possibility
  +     * of circular references.
        */
       public boolean isPrimitive(Object value)
       {
  -        if (value instanceof String) return true;
  -        if (value instanceof Number) return true;
  -        if (value instanceof Boolean) return true;
  -        if (value instanceof Date) return true;
  -        if (value instanceof byte[]) return true;
  +        Class type = value.getClass();
  +        if (type.isArray()) type = type.getComponentType();
  +
  +        if (String.class.isAssignableFrom(type)) return true;
  +        if (Number.class.isAssignableFrom(type)) return true;
  +        if (Boolean.class.isAssignableFrom(type)) return true;
  +        if (Date.class.isAssignableFrom(type)) return true;
  +        if (byte[].class.isAssignableFrom(type)) return true;
           return false;
       }
       
  
  
  

Mime
View raw message