cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r737849 - in /cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl: generator/wsdl11/FaultBeanGenerator.java processor/internal/jaxws/FaultBean.java
Date Mon, 26 Jan 2009 21:13:02 GMT
Author: dkulp
Date: Mon Jan 26 21:13:02 2009
New Revision: 737849

URL: http://svn.apache.org/viewvc?rev=737849&view=rev
Log:
[CXF-2001] Don't regen fault beans that are already there

Modified:
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGenerator.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGenerator.java?rev=737849&r1=737848&r2=737849&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGenerator.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGenerator.java
Mon Jan 26 21:13:02 2009
@@ -58,7 +58,9 @@
         String defaultPackage = seiPackageName + ".jaxws";
         FaultBean bean = new FaultBean();
         for (Class clz : exceptionClasses) {
-            faultBeanClasses.add(bean.transform(clz, defaultPackage));
+            if (!bean.faultBeanExists(clz)) {
+                faultBeanClasses.add(bean.transform(clz, defaultPackage));
+            }
         }
 
         return faultBeanClasses;

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java?rev=737849&r1=737848&r2=737849&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java
Mon Jan 26 21:13:02 2009
@@ -34,6 +34,7 @@
 import org.apache.cxf.tools.common.model.JavaField;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.annotator.WrapperBeanAnnotator;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.model.WrapperBeanClass;
+import org.apache.cxf.tools.util.AnnotationUtil;
 import org.apache.cxf.tools.util.URIParserUtil;
 
 public final class FaultBean {
@@ -42,6 +43,18 @@
                                                                   "getStackTrace",
                                                                   "getClass"};
 
+    public boolean faultBeanExists(final Class<?> exceptionClass) {
+        String fb = getWebFaultBean(exceptionClass);
+        if (!StringUtils.isEmpty(fb)) {
+            try {
+                return AnnotationUtil.loadClass(fb,
+                                                exceptionClass.getClassLoader()) != null;
+            } catch (Exception e) {
+                return false;
+            }
+        }
+        return false; 
+    }
     
     private String getWebFaultBean(final Class<?> exceptionClass) {
         WebFault fault = exceptionClass.getAnnotation(WebFault.class);



Mime
View raw message