Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 74581 invoked by uid 500); 27 Aug 2002 16:08:10 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 74571 invoked by uid 500); 27 Aug 2002 16:08:10 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 27 Aug 2002 16:08:10 -0000 Message-ID: <20020827160810.2625.qmail@icarus.apache.org> From: tomj@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/java/src/org/apache/axis/encoding SerializationContextImpl.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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;