cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1452682 - in /cxf/branches/2.6.x-fixes: ./ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/ tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/
Date Tue, 05 Mar 2013 07:40:59 GMT
Author: ema
Date: Tue Mar  5 07:40:59 2013
New Revision: 1452682

URL: http://svn.apache.org/r1452682
Log:
Merged revisions 1452681 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1452681 | ema | 2013-03-05 15:37:24 +0800 (Tue, 05 Mar 2013) | 9 lines
  
  Merged revisions 1452679 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1452679 | ema | 2013-03-05 15:26:00 +0800 (Tue, 05 Mar 2013) | 1 line
    
    [CXF-4847]:Data types not correctly published in WSDL from Exception classes;Apply patch
from mustafa
  ........
................

Added:
    cxf/branches/2.6.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo2.java
      - copied unchanged from r1452681, cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo2.java
    cxf/branches/2.6.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo2Impl.java
      - copied unchanged from r1452681, cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/Echo2Impl.java
    cxf/branches/2.6.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/ListException.java
      - copied unchanged from r1452681, cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/ListException.java
    cxf/branches/2.6.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyData.java
      - copied unchanged from r1452681, cxf/branches/2.7.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/MyData.java
Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
    cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
    cxf/branches/2.6.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1452681
  Merged /cxf/trunk:r1452679

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

Modified: cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?rev=1452682&r1=1452681&r2=1452682&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Tue Mar  5 07:40:59 2013
@@ -543,6 +543,12 @@ class JAXBSchemaInitializer extends Serv
         for (Method m : Utils.getGetters(cls, accessType)) {
             //map method
             Type type = Utils.getMethodReturnType(m);
+            // we want to return the right type for collections so if we get null
+            // from the return type we check if it's ParameterizedType and get the
+            // generic return type.
+            if ((type == null) && (m.getGenericReturnType() instanceof ParameterizedType))
{
+                type = m.getGenericReturnType();
+            }
             JAXBBeanInfo beanInfo = getBeanInfo(type);
             if (beanInfo != null) {
                 int idx = m.getName().startsWith("get") ? 3 : 2;

Modified: cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java?rev=1452682&r1=1452681&r2=1452682&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Utils.java
Tue Mar  5 07:40:59 2013
@@ -211,8 +211,14 @@ final class Utils {
 
     static Class<?> getMethodReturnType(Method m) {
         XmlJavaTypeAdapter adapter = getMethodXJTA(m);
+        // if there is no adapter, yet we have a collection make sure
+        // we return the Generic type; if there is an annotation let the
+        // adapter handle what gets populated
+        if (adapter == null && m.getGenericReturnType() instanceof ParameterizedType)
{
+            return null;
+        }
         Class<?> adapterType = (Class<?>)getTypeFromXmlAdapter(adapter);
-        return adapterType != null ? adapterType : m.getReturnType(); 
+        return adapterType != null ? adapterType : m.getReturnType();
     }
 
     @SuppressWarnings({ "rawtypes", "unchecked" })

Modified: cxf/branches/2.6.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?rev=1452682&r1=1452681&r2=1452682&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Tue Mar  5 07:40:59 2013
@@ -752,5 +752,26 @@ public class JavaToProcessorTest extends
         assertTrue(summaryIndex > idIndex && idIndex > fromIndex);        
     }
     
+    @Test
+    public void testExceptionList() throws Exception {
+        env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/exception_list.wsdl");
+        env.put(ToolConstants.CFG_CLASSNAME, "org.apache.cxf.tools.fortest.exception.Echo2Impl");
+        env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
+        try {
+            processor.setEnvironment(env);
+            processor.process();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        
+        File wsdlFile = new File(output, "exception_list.wsdl");
+        assertTrue(wsdlFile.exists());
+        String wsdlContent = getStringFromFile(wsdlFile).replaceAll("  ", " ");
+        int unboundIndex = wsdlContent
+            .indexOf("<xs:element maxOccurs=\"unbounded\" minOccurs=\"0\" name=\"names\"
type=\"tns:myData\"/>");
+        assertTrue(unboundIndex > -1);
+    }
+    
+    
     
 }



Mime
View raw message