cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r638414 - in /incubator/cxf/branches/2.0.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ systests/src/test/java/org/apache/cxf/systest/jaxws/
Date Tue, 18 Mar 2008 15:26:23 GMT
Author: dkulp
Date: Tue Mar 18 08:26:19 2008
New Revision: 638414

URL: http://svn.apache.org/viewvc?rev=638414&view=rev
Log:
Merged revisions 638158 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r638158 | dkulp | 2008-03-17 20:39:25 -0400 (Mon, 17 Mar 2008) | 2 lines
  
  [CXF-1476] Exceptions in in/out params the used generics or multi-arrays
........

Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
    incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
    incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?rev=638414&r1=638413&r2=638414&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Tue Mar 18 08:26:19 2008
@@ -20,8 +20,6 @@
 package org.apache.cxf.jaxws.support;
 
 import java.lang.annotation.Annotation;
-import java.lang.reflect.Array;
-import java.lang.reflect.GenericArrayType;
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
@@ -728,27 +726,13 @@
         return Holder.class.equals(cls);
     }
     
-    public Class<?> getHolderType(Class<?> cls, Type type) {
+    public Type getHolderType(Class<?> cls, Type type) {
         if (cls.equals(Holder.class) && type instanceof ParameterizedType) {
             ParameterizedType paramType = (ParameterizedType)type;
-            cls = getHolderClass(paramType);
+            return paramType.getActualTypeArguments()[0];
         }
 
         return cls;
     }   
     
-    private static Class getHolderClass(ParameterizedType paramType) {
-        Object rawType = paramType.getActualTypeArguments()[0];
-        Class rawClass;
-        if (rawType instanceof GenericArrayType) {
-            rawClass = (Class)((GenericArrayType)rawType).getGenericComponentType();
-            rawClass = Array.newInstance(rawClass, 0).getClass();
-        } else {
-            if (rawType instanceof ParameterizedType) {
-                rawType = (Class)((ParameterizedType)rawType).getRawType();
-            }
-            rawClass = (Class)rawType;
-        }
-        return rawClass;
-    }
 }

Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java?rev=638414&r1=638413&r2=638414&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
Tue Mar 18 08:26:19 2008
@@ -184,7 +184,7 @@
         return null;
     }
     
-    public Class<?> getHolderType(Class<?> cls, Type type) {
+    public Type getHolderType(Class<?> cls, Type type) {
         return null;
     }
 }

Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=638414&r1=638413&r2=638414&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Tue Mar 18 08:26:19 2008
@@ -19,8 +19,11 @@
 
 package org.apache.cxf.service.factory;
 
+import java.lang.reflect.Array;
 import java.lang.reflect.Field;
+import java.lang.reflect.GenericArrayType;
 import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
 import java.net.MalformedURLException;
@@ -1327,11 +1330,42 @@
         }
     }
 
+    private static Class createArrayClass(GenericArrayType atp) {
+        Type tp = ((GenericArrayType)atp).getGenericComponentType();
+        Class rawClass = null;
+        if (tp instanceof Class) {
+            rawClass = (Class)tp;
+        } else if (tp instanceof GenericArrayType) {
+            rawClass = createArrayClass((GenericArrayType)tp);
+        } else if (tp instanceof ParameterizedType) {
+            rawClass = (Class)((ParameterizedType)tp).getRawType();
+            if (List.class.isAssignableFrom(rawClass)) { 
+                rawClass = getClass((ParameterizedType)tp);
+                rawClass = Array.newInstance(rawClass, 0).getClass();
+            }
+        }
+        return Array.newInstance(rawClass, 0).getClass();
+    }
+    
+    private static Class getClass(Type paramType) {
+        Class rawClass = null;
+        if (paramType instanceof Class) {
+            rawClass = (Class)paramType;
+        } else if (paramType instanceof GenericArrayType) {
+            rawClass = createArrayClass((GenericArrayType)paramType);
+        } else if (paramType instanceof ParameterizedType) {
+            rawClass = (Class)((ParameterizedType)paramType).getRawType();
+        } 
+        return rawClass;
+    }
+    
+    
     protected void initializeParameter(MessagePartInfo part, Class rawClass, Type type) {
         if (isHolder(rawClass, type)) {
-            Class<?> c = getHolderType(rawClass, type);
+            Type c = getHolderType(rawClass, type);
             if (c != null) {
-                rawClass = c;
+                type = c;
+                rawClass = getClass(type);
             }
         }
 
@@ -1425,9 +1459,9 @@
         return false;
     }
     
-    public Class<?> getHolderType(Class<?> cls, Type type) {
+    public Type getHolderType(Class<?> cls, Type type) {
         for (AbstractServiceConfiguration c : serviceConfigurations) {
-            Class<?> b = c.getHolderType(cls, type);
+            Type b = c.getHolderType(cls, type);
             if (b != null) {
                 return b;
             }

Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?rev=638414&r1=638413&r2=638414&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
Tue Mar 18 08:26:19 2008
@@ -350,7 +350,7 @@
             port.throwException(10);
             fail("Expected exception not found");
         } catch (ServiceTestFault ex) {
-            assertEquals(10, ex.getFaultInfo().getId());
+            assertEquals(10L, ex.getFaultInfo().getId());
         }
         // CXF-1131 testcase
         try {

Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java?rev=638414&r1=638413&r2=638414&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
Tue Mar 18 08:26:19 2008
@@ -80,6 +80,11 @@
     List<Foo> listObjectOutput();
 
     @WebMethod
+    boolean listObjectIn(@WebParam(mode = WebParam.Mode.INOUT)
+                         Holder<List<Foo[]>> foos);
+
+    
+    @WebMethod
     List<Foo[]> listObjectArrayOutput();
     
     @WebMethod

Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java?rev=638414&r1=638413&r2=638414&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
Tue Mar 18 08:26:19 2008
@@ -152,4 +152,8 @@
         return i;
     }
 
+
+    public boolean listObjectIn(Holder<List<Foo[]>> foos) {
+        return false;
+    }
 }



Mime
View raw message