axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/providers/java CORBAProvider.java
Date Tue, 12 Aug 2003 03:39:53 GMT
ericf       2003/08/11 20:39:53

  Modified:    java/src/org/apache/axis/encoding/ser
                        BaseDeserializerFactory.java BaseFactory.java
                        BaseSerializerFactory.java EnumDeserializer.java
               java/src/org/apache/axis/providers/java CORBAProvider.java
  Log:
  fix for 22334 - use constant Class[] arrays for invariants
  
  Revision  Changes    Path
  1.15      +5 -7      xml-axis/java/src/org/apache/axis/encoding/ser/BaseDeserializerFactory.java
  
  Index: BaseDeserializerFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BaseDeserializerFactory.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- BaseDeserializerFactory.java	1 May 2003 17:05:51 -0000	1.14
  +++ BaseDeserializerFactory.java	12 Aug 2003 03:39:53 -0000	1.15
  @@ -153,13 +153,14 @@
           return null;
       }
   
  +    private static final Class[] CLASS_QNAME_CLASS = new Class[] {Class.class, QName.class};
  +    
       /**
        * return constructor for class if any
        */ 
        private Constructor getConstructor(Class clazz) {
           try {
  -           return clazz.getConstructor(
  -                   new Class[] {Class.class, QName.class});
  +            return clazz.getConstructor(CLASS_QNAME_CLASS);
           } catch (NoSuchMethodException e) {}
           return null;
        }
  @@ -212,9 +213,7 @@
           DeserializerFactory df = null;
           try {
               Method method = 
  -                factory.getMethod(
  -                    "create", 
  -                    new Class[] {Class.class, QName.class});
  +                factory.getMethod("create", CLASS_QNAME_CLASS);
               df = (DeserializerFactory) 
                   method.invoke(null, 
                                 new Object[] {javaType, xmlType});
  @@ -225,8 +224,7 @@
           if (df == null) {
               try {
                   Constructor constructor =  
  -                    factory.getConstructor(
  -                        new Class[] {Class.class, QName.class});
  +                    factory.getConstructor(CLASS_QNAME_CLASS);
                   df = (DeserializerFactory) 
                       constructor.newInstance(
                           new Object[] {javaType, xmlType});
  
  
  
  1.3       +6 -1      xml-axis/java/src/org/apache/axis/encoding/ser/BaseFactory.java
  
  Index: BaseFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BaseFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BaseFactory.java	13 Jul 2003 22:34:57 -0000	1.2
  +++ BaseFactory.java	12 Aug 2003 03:39:53 -0000	1.3
  @@ -69,13 +69,18 @@
    * @author Davanum Srinivas <dims@yahoo.com> 
    */
   public abstract class BaseFactory {
  +
  +    private static final Class[] STRING_CLASS_QNAME_CLASS = new Class[] {
  +        String.class, Class.class, QName.class
  +    };
  +    
       /**
        * Returns the the specified method - if any.
        */
       protected Method getMethod(Class clazz, String methodName) {
           Method method = null;
           try {
  -            method = MethodCache.getInstance().getMethod(clazz, methodName, new Class[]{String.class,
Class.class, QName.class});
  +            method = MethodCache.getInstance().getMethod(clazz, methodName, STRING_CLASS_QNAME_CLASS);
           } catch (NoSuchMethodException e) {
           }
           return method;
  
  
  
  1.24      +14 -15    xml-axis/java/src/org/apache/axis/encoding/ser/BaseSerializerFactory.java
  
  Index: BaseSerializerFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BaseSerializerFactory.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- BaseSerializerFactory.java	1 May 2003 17:05:51 -0000	1.23
  +++ BaseSerializerFactory.java	12 Aug 2003 03:39:53 -0000	1.24
  @@ -133,7 +133,7 @@
           } catch (Exception e) {
               throw new JAXRPCException(
                   Messages.getMessage("CantGetSerializer", 
  -                                     serClass.getName()),
  +                                    serClass.getName()),
                   e);
           }
           return serializer;
  @@ -158,14 +158,16 @@
           }
           return null;
       }
  +
  +
  +    private static final Class[] CLASS_QNAME_CLASS = new Class[] { Class.class, QName.class
};
       
  -   /**
  -    * return constructor for class if any
  -    */ 
  +    /**
  +     * return constructor for class if any
  +     */ 
       private Constructor getConstructor(Class clazz) {
           try {
  -           return clazz.getConstructor(
  -                   new Class[] {Class.class, QName.class});
  +            return clazz.getConstructor(CLASS_QNAME_CLASS);
           } catch (NoSuchMethodException e) {}
           return null;
       }
  @@ -180,10 +182,10 @@
                   try {
                       return (Serializer) 
                           getSerializer.invoke(
  -                                             null,
  -                                             new Object[] {mechanismType, 
  -                                                           javaType, 
  -                                                           xmlType});
  +                            null,
  +                            new Object[] {mechanismType, 
  +                                          javaType, 
  +                                          xmlType});
                   } catch (IllegalAccessException e) {
                   } catch (InvocationTargetException e) {}
               }
  @@ -239,9 +241,7 @@
           SerializerFactory sf = null;
           try {
               Method method = 
  -                factory.getMethod(
  -                    "create",
  -                    new Class[] {Class.class, QName.class});
  +                factory.getMethod("create", CLASS_QNAME_CLASS);
               sf = (SerializerFactory) 
                   method.invoke(null, 
                                 new Object[] {javaType, xmlType});
  @@ -252,8 +252,7 @@
           if (sf == null) {
               try {
                   Constructor constructor =  
  -                    factory.getConstructor(
  -                        new Class[] {Class.class, QName.class});
  +                    factory.getConstructor(CLASS_QNAME_CLASS);
                   sf = (SerializerFactory) 
                       constructor.newInstance(
                           new Object[] {javaType, xmlType});
  
  
  
  1.6       +3 -2      xml-axis/java/src/org/apache/axis/encoding/ser/EnumDeserializer.java
  
  Index: EnumDeserializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/EnumDeserializer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- EnumDeserializer.java	22 Apr 2003 19:34:29 -0000	1.5
  +++ EnumDeserializer.java	12 Aug 2003 03:39:53 -0000	1.6
  @@ -69,6 +69,8 @@
   
       private Method fromStringMethod = null;
   
  +    private static final Class[] STRING_CLASS = new Class[] { java.lang.String.class };
  +
       public EnumDeserializer(Class javaType, QName xmlType) {
           super(javaType, xmlType);
       }
  @@ -80,8 +82,7 @@
               return null;
           if (fromStringMethod == null) {
               try {
  -                fromStringMethod = javaType.getMethod("fromString", 
  -                                                 new Class[] {java.lang.String.class});
  +                fromStringMethod = javaType.getMethod("fromString", STRING_CLASS);
               } catch (Exception e) {
                   throw new IntrospectionException(e.toString());
               }
  
  
  
  1.4       +3 -1      xml-axis/java/src/org/apache/axis/providers/java/CORBAProvider.java
  
  Index: CORBAProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/CORBAProvider.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CORBAProvider.java	22 Apr 2003 19:35:33 -0000	1.3
  +++ CORBAProvider.java	12 Aug 2003 03:39:53 -0000	1.4
  @@ -131,11 +131,13 @@
   
           Class helperClass = ClassUtils.forName(helperClassName);
           // Narrow the object reference
  -        Method narrowMethod = helperClass.getMethod("narrow", new Class[] {org.omg.CORBA.Object.class});
  +        Method narrowMethod = helperClass.getMethod("narrow", CORBA_OBJECT_CLASS);
           Object targetObject = narrowMethod.invoke(null, new Object[] {corbaObject});
   
           return targetObject;
       }
  +
  +    private static final Class[] CORBA_OBJECT_CLASS = new Class[] {org.omg.CORBA.Object.class};
   
       /**
        * Return the option in the configuration that contains the service class
  
  
  

Mime
View raw message