cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r658397 - /cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Date Tue, 20 May 2008 19:03:32 GMT
Author: dkulp
Date: Tue May 20 12:03:32 2008
New Revision: 658397

URL: http://svn.apache.org/viewvc?rev=658397&view=rev
Log:
[CXF-1204] Patch from Benjamin Coiffe applied.  Thanks!


Modified:
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=658397&r1=658396&r2=658397&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Tue May 20 12:03:32 2008
@@ -175,9 +175,7 @@
 
         for (Iterator<JPackage> packages = codeModel.packages(); packages.hasNext();)
{
             JPackage jpackage = packages.next();
-            String name = jpackage.name();
-            if ("org.w3._2001.xmlschema".equals(name)
-                || !jpackage.classes().hasNext()) {
+            if (!isValidPackage(jpackage)) {
                 continue;
             }
             if (firstnt) {
@@ -262,6 +260,27 @@
         return client;
     }
 
+    private boolean isValidPackage(JPackage jpackage) {
+        if (jpackage == null) {
+            return false;
+        }
+        String name = jpackage.name();
+        if ("org.w3._2001.xmlschema".equals(name)
+            || "java.lang".equals(name)
+            || "java.io".equals(name)
+            || "generated".equals(name)) {
+            return false;
+        }
+        Iterator<JDefinedClass> i = jpackage.classes();
+        while (i.hasNext()) {
+            JDefinedClass current = i.next();
+            if ("ObjectFactory".equals(current.name())) { 
+                return true;
+            }
+        }
+        return false;
+    }
+
     private void outputDebug(JCodeModel codeModel) {
         if (!LOG.isLoggable(Level.INFO)) {
             return;



Mime
View raw message