axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/i18n resource.properties
Date Wed, 19 Nov 2003 18:52:59 GMT
dims        2003/11/19 10:52:59

  Modified:    java/src/org/apache/axis/encoding/ser
                        BaseDeserializerFactory.java
                        BaseSerializerFactory.java
               java/src/org/apache/axis/i18n resource.properties
  Log:
  Fix for Bug 24502 - Param Checking in BasicSerializerFactory
  from matthew_pocock@yahoo.co.uk
  
  Revision  Changes    Path
  1.16      +14 -11    ws-axis/java/src/org/apache/axis/encoding/ser/BaseDeserializerFactory.java
  
  Index: BaseDeserializerFactory.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/BaseDeserializerFactory.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- BaseDeserializerFactory.java	12 Aug 2003 03:39:53 -0000	1.15
  +++ BaseDeserializerFactory.java	19 Nov 2003 18:52:59 -0000	1.16
  @@ -55,22 +55,18 @@
   
   package org.apache.axis.encoding.ser;
   
  -import java.io.Serializable;
  +import org.apache.axis.Constants;
  +import org.apache.axis.encoding.Deserializer;
  +import org.apache.axis.encoding.DeserializerFactory;
  +import org.apache.axis.i18n.Messages;
  +
  +import javax.xml.namespace.QName;
  +import javax.xml.rpc.JAXRPCException;
   import java.lang.reflect.Constructor;
   import java.lang.reflect.InvocationTargetException;
   import java.lang.reflect.Method;
   import java.util.Iterator;
   import java.util.Vector;
  -import java.util.Map;
  -import java.util.HashMap;
  -import javax.xml.namespace.QName;
  -import javax.xml.rpc.JAXRPCException;
  -
  -import org.apache.axis.Constants;
  -import org.apache.axis.MessageContext;
  -import org.apache.axis.encoding.Deserializer;
  -import org.apache.axis.encoding.DeserializerFactory;
  -import org.apache.axis.utils.ClassUtils;
   
   /**
    * Base class for Axis Deserialization Factory classes for code reuse
  @@ -94,10 +90,17 @@
        * @param deserClass is the class of the Deserializer
        */
       public BaseDeserializerFactory(Class deserClass) {
  +        if (!Deserializer.class.isAssignableFrom(deserClass)) {
  +            throw new ClassCastException(
  +                    Messages.getMessage("BadImplementation00",
  +                            deserClass.getName(),
  +                            Deserializer.class.getName()));
  +        }
           this.deserClass = deserClass;
           this.mechanisms = new Vector();
           this.mechanisms.add(Constants.AXIS_SAX);
       }
  +
       public BaseDeserializerFactory(Class deserClass,
                                      QName xmlType,
                                      Class javaType) {
  
  
  
  1.25      +7 -2      ws-axis/java/src/org/apache/axis/encoding/ser/BaseSerializerFactory.java
  
  Index: BaseSerializerFactory.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/BaseSerializerFactory.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- BaseSerializerFactory.java	12 Aug 2003 03:39:53 -0000	1.24
  +++ BaseSerializerFactory.java	19 Nov 2003 18:52:59 -0000	1.25
  @@ -58,7 +58,6 @@
   import org.apache.axis.Constants;
   import org.apache.axis.encoding.Serializer;
   import org.apache.axis.encoding.SerializerFactory;
  -import org.apache.axis.utils.ClassUtils;
   import org.apache.axis.utils.Messages;
   
   import javax.xml.namespace.QName;
  @@ -68,7 +67,6 @@
   import java.lang.reflect.Method;
   import java.util.Iterator;
   import java.util.Vector;
  -import java.io.Serializable;
   
   /**
    * Base class for Axis Serialization Factory classes for code reuse
  @@ -94,8 +92,15 @@
        * Sharing is only valid for xml primitives.
        */
       public BaseSerializerFactory(Class serClass) {
  +        if (!Serializer.class.isAssignableFrom(serClass)) {
  +            throw new ClassCastException(
  +                    Messages.getMessage("BadImplementation00",
  +                            serClass.getName(),
  +                            Serializer.class.getName()));
  +        }
           this.serClass = serClass;
       }
  +
       public BaseSerializerFactory(Class serClass,
                                    QName xmlType, Class javaType) {
           this(serClass);
  
  
  
  1.74      +1 -0      ws-axis/java/src/org/apache/axis/i18n/resource.properties
  
  Index: resource.properties
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/i18n/resource.properties,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- resource.properties	27 Oct 2003 13:27:19 -0000	1.73
  +++ resource.properties	19 Nov 2003 18:52:59 -0000	1.74
  @@ -915,6 +915,7 @@
   CantGetSerializer=unable to get serializer for class {0}
   unknownPortName=Cannot set Endpoint Address for Unknown Port
   setEndpointDoc00=Set the endpoint address for the specified port name.
  +BadImplementation00=class {0} must implement {1}
   
   
   noVector00={0}:  {1} is not a vector
  
  
  

Mime
View raw message