axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/encoding SerializationContextImpl.java
Date Tue, 27 Aug 2002 16:08:10 GMT
tomj        2002/08/27 09:08:10

  Modified:    java/src/org/apache/axis/encoding
                        SerializationContextImpl.java
  Log:
  Fix bug 12010 - Only immediate interfaces are used in finding a serializer
    http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12010
  
  Added the patch as given.
  
  Revision  Changes    Path
  1.62      +29 -11    xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java
  
  Index: SerializationContextImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- SerializationContextImpl.java	24 Aug 2002 23:11:00 -0000	1.61
  +++ SerializationContextImpl.java	27 Aug 2002 16:08:09 -0000	1.62
  @@ -1175,6 +1175,33 @@
           // !!! Write out a generic null, or get type info from somewhere else?
       }
   
  +
  +    /**
  +     * Walk the interfaces of a class looking for a serializer for that
  +     * interface.  Include any parent interfaces in the search also.
  +     * 
  +     */ 
  +    private SerializerFactory getSerializerFactoryFromInterface(Class javaType, 
  +                                                                QName xmlType, 
  +                                                                TypeMapping tm)
  +    {
  +        SerializerFactory  serFactory  = null ;
  +        Class [] interfaces = javaType.getInterfaces();
  +        if (interfaces != null) {
  +            for (int i = 0; i < interfaces.length; i++) {
  +                Class iface = interfaces[i];
  +                serFactory = (SerializerFactory) tm.getSerializer(iface,
  +                                                                  xmlType);
  +                if (serFactory == null)
  +                    serFactory = getSerializerFactoryFromInterface(iface, xmlType, tm);
  +                if (serFactory != null)
  +                    break;
  +                   
  +            }
  +        }
  +        return serFactory;
  +    }
  +    
       /**
        * getSerializer
        * Attempts to get a serializer for the indicated javaType and xmlType.
  @@ -1192,17 +1219,8 @@
                   break;
   
               // Walk my interfaces...
  -            Class [] interfaces = javaType.getInterfaces();
  -            if (interfaces != null) {
  -                for (int i = 0; i < interfaces.length; i++) {
  -                    Class iface = interfaces[i];
  -                    serFactory = (SerializerFactory) tm.getSerializer(iface,
  -                                                                      xmlType);
  -                    if (serFactory != null)
  -                        break;
  -                }
  -            }
  -
  +            serFactory = getSerializerFactoryFromInterface(javaType, xmlType, tm);
  +            
               // Finally, head to my superclass
               if (serFactory != null)
                   break;
  
  
  

Mime
View raw message