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 TypeMappingRegistry.java
Date Wed, 12 Dec 2001 21:39:25 GMT
rubys       01/12/12 13:39:25

  Modified:    java/src/org/apache/axis/encoding Tag: alpha-3
                        TypeMappingRegistry.java
  Log:
  Now we should have a TMR that both Dug and Glen can agree on.  ;-)
  
  Tested with both Crimson and Xerces.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.36.2.2  +24 -18    xml-axis/java/src/org/apache/axis/encoding/TypeMappingRegistry.java
  
  Index: TypeMappingRegistry.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/TypeMappingRegistry.java,v
  retrieving revision 1.36.2.1
  retrieving revision 1.36.2.2
  diff -u -r1.36.2.1 -r1.36.2.2
  --- TypeMappingRegistry.java	2001/12/12 16:37:08	1.36.2.1
  +++ TypeMappingRegistry.java	2001/12/12 21:39:25	1.36.2.2
  @@ -69,7 +69,7 @@
   import java.io.Serializable;
   import java.util.Enumeration;
   import java.util.Hashtable;
  -import java.util.Vector;
  +import java.util.ArrayList;
   
   /**
    * @author James Snell (jasnell@us.ibm.com)
  @@ -243,24 +243,30 @@
       {
           if (value != null) {
               Serializer  ser     = null ;
  -            Class       _class  = null ;
  +            Class       _class  = value.getClass();
   
  -            // Check the most common case first
  -            ser = getSerializer( _class = value.getClass() );
  -            if ( ser == null ) {
  -                Vector  classes = new Vector();
  -                classes.add( _class );
  -        
  -                while( classes.size() != 0 ) {
  -                    _class = (Class) classes.remove( 0 );
  -                    if ( (ser = getSerializer(_class)) != null ) break ;
  -                    if ( classes == null ) classes = new Vector();
  -                    Class[] ifaces = _class.getInterfaces();
  -                    for (int i = 0 ; i < ifaces.length ; i++ ) 
  -                        classes.add( ifaces[i] );
  -                    _class = _class.getSuperclass();
  -                    if ( _class != null ) classes.add( _class );
  -                }
  +            // Use an ArrayList and remove(0) because it MUST be 
  +            // first-in-first-out
  +            ArrayList  classes = null;
  +            
  +            while( _class != null ) {
  +                if ( (ser = getSerializer(_class)) != null ) break ;
  +                if ( classes == null ) classes = new ArrayList();
  +                Class[] ifaces = _class.getInterfaces();
  +                for (int i = 0 ; i < ifaces.length ; i++ ) 
  +                    classes.add( ifaces[i] );
  +                _class = _class.getSuperclass();
  +                
  +                // Add any non-null (and non-Object) class.  We skip
  +                // the Object class because if we reach that then
  +                // there's an error and this error message return 
  +                // here is better than the one returned by the
  +                // ObjSerializer.
  +                if ( _class != null &&
  +                        !_class.getName().equals("java.lang.Object")) 
  +                    classes.add( _class );
  +                
  +                _class = (Class) classes.remove( 0 );
               }
   
               if ( ser != null ) {
  
  
  

Mime
View raw message