cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r797442 - in /cxf/trunk: common/xjc/ common/xjc/bug671/ common/xjc/bug671/src/ common/xjc/bug671/src/main/ common/xjc/bug671/src/main/java/ common/xjc/bug671/src/main/java/com/ common/xjc/bug671/src/main/java/com/sun/ common/xjc/bug671/src/...
Date Fri, 24 Jul 2009 13:31:24 GMT
Author: dkulp
Date: Fri Jul 24 13:31:23 2009
New Revision: 797442

URL: http://svn.apache.org/viewvc?rev=797442&view=rev
Log:
Add a xjc plugin to workaround
https://jaxb.dev.java.net/issues/show_bug.cgi?id=671

Added:
    cxf/trunk/common/xjc/bug671/
    cxf/trunk/common/xjc/bug671/pom.xml
      - copied, changed from r797233, cxf/trunk/common/xjc/pom.xml
    cxf/trunk/common/xjc/bug671/src/
    cxf/trunk/common/xjc/bug671/src/main/
    cxf/trunk/common/xjc/bug671/src/main/java/
    cxf/trunk/common/xjc/bug671/src/main/java/com/
    cxf/trunk/common/xjc/bug671/src/main/java/com/sun/
    cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/
    cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/xjc/
    cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/xjc/addon/
    cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/xjc/addon/apache_cxf/
    cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/xjc/addon/apache_cxf/bug671/
    cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/xjc/addon/apache_cxf/bug671/Bug671Plugin.java
  (with props)
    cxf/trunk/common/xjc/bug671/src/main/java/org/
    cxf/trunk/common/xjc/bug671/src/main/java/org/apache/
    cxf/trunk/common/xjc/bug671/src/main/java/org/apache/cxf/
    cxf/trunk/common/xjc/bug671/src/main/java/org/apache/cxf/xjc/
    cxf/trunk/common/xjc/bug671/src/main/java/org/apache/cxf/xjc/bug671/
    cxf/trunk/common/xjc/bug671/src/main/java/org/apache/cxf/xjc/bug671/Bug671Plugin.java
  (with props)
    cxf/trunk/common/xjc/bug671/src/main/resources/
    cxf/trunk/common/xjc/bug671/src/main/resources/META-INF/
    cxf/trunk/common/xjc/bug671/src/main/resources/META-INF/services/
    cxf/trunk/common/xjc/bug671/src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin
Modified:
    cxf/trunk/common/xjc/pom.xml
    cxf/trunk/distribution/bundle/all/pom.xml
    cxf/trunk/distribution/manifest/pom.xml
    cxf/trunk/distribution/pom.xml

Copied: cxf/trunk/common/xjc/bug671/pom.xml (from r797233, cxf/trunk/common/xjc/pom.xml)
URL: http://svn.apache.org/viewvc/cxf/trunk/common/xjc/bug671/pom.xml?p2=cxf/trunk/common/xjc/bug671/pom.xml&p1=cxf/trunk/common/xjc/pom.xml&r1=797233&r2=797442&rev=797442&view=diff
==============================================================================
--- cxf/trunk/common/xjc/pom.xml (original)
+++ cxf/trunk/common/xjc/bug671/pom.xml Fri Jul 24 13:31:23 2009
@@ -18,33 +18,47 @@
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
-    <groupId>org.apache.cxf</groupId>
-    <artifactId>cxf-xjc</artifactId>
-    <packaging>pom</packaging>
+    <groupId>org.apache.cxf.xjcplugins</groupId>
+    <artifactId>cxf-xjc-bug671</artifactId>
+    <packaging>jar</packaging>
     <version>2.3.0-SNAPSHOT</version>
-    <name>Apache CXF XJC Plugins</name>
+    <name>Apache CXF XJC Plugin To Workaround JAXB Bug 671</name>
     <url>http://cxf.apache.org</url>
 
     <parent>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-parent</artifactId>
         <version>2.3.0-SNAPSHOT</version>
-        <relativePath>../../parent/pom.xml</relativePath>
+        <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 
-    <modules>
-        <module>dv</module>
-        <module>ts</module>
-        <module>wsdlextension</module>
-        <module>dv-test</module>
-        <module>ts-test</module>
-        <module>wsdlextension-test</module>
-    </modules>
+    <properties>
+        <maven.test.skip>true</maven.test.skip>
+    </properties>
 
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-common-utilities</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-xjc</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+        </dependency>
+    </dependencies>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/cxf/trunk/common/xjc</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/cxf/trunk/common/xjc</developerConnection>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/cxf/trunk/common/xjc/bug671</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/cxf/trunk/common/xjc/bug671</developerConnection>
     </scm>
 
 </project>

Added: cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/xjc/addon/apache_cxf/bug671/Bug671Plugin.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/xjc/addon/apache_cxf/bug671/Bug671Plugin.java?rev=797442&view=auto
==============================================================================
--- cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/xjc/addon/apache_cxf/bug671/Bug671Plugin.java
(added)
+++ cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/xjc/addon/apache_cxf/bug671/Bug671Plugin.java
Fri Jul 24 13:31:23 2009
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.sun.tools.xjc.addon.apache_cxf.bug671;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import com.sun.tools.xjc.BadCommandLineException;
+import com.sun.tools.xjc.Options;
+import com.sun.tools.xjc.Plugin;
+import com.sun.tools.xjc.outline.Outline;
+
+/**
+ * Thin wrapper around the Bug671Plugin. This must be in the com.sun.tools.xjc.addon package
+ * for it to work with Java 6. See https://issues.apache.org/jira/browse/CXF-1880.
+ */
+public class Bug671Plugin extends Plugin {
+    
+    org.apache.cxf.xjc.bug671.Bug671Plugin impl = new org.apache.cxf.xjc.bug671.Bug671Plugin(this);
+    
+    /* (non-Javadoc)
+     * @see com.sun.tools.xjc.Plugin#getOptionName()
+     */
+    @Override
+    public String getOptionName() {
+        return impl.getOptionName();
+    }
+
+    /* (non-Javadoc)
+     * @see com.sun.tools.xjc.Plugin#getUsage()
+     */
+    @Override
+    public String getUsage() {
+        return impl.getUsage();
+    }
+    public void onActivated(Options opts) throws BadCommandLineException {
+        impl.onActivated(opts);
+    }
+    /* (non-Javadoc)
+     * @see com.sun.tools.xjc.Plugin#run(com.sun.tools.xjc.outline.Outline,
+     *   com.sun.tools.xjc.Options, org.xml.sax.ErrorHandler)
+     */
+    @Override
+    public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) throws SAXException
{
+        return true;
+    }
+
+}

Propchange: cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/xjc/addon/apache_cxf/bug671/Bug671Plugin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/common/xjc/bug671/src/main/java/com/sun/tools/xjc/addon/apache_cxf/bug671/Bug671Plugin.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/common/xjc/bug671/src/main/java/org/apache/cxf/xjc/bug671/Bug671Plugin.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/xjc/bug671/src/main/java/org/apache/cxf/xjc/bug671/Bug671Plugin.java?rev=797442&view=auto
==============================================================================
--- cxf/trunk/common/xjc/bug671/src/main/java/org/apache/cxf/xjc/bug671/Bug671Plugin.java
(added)
+++ cxf/trunk/common/xjc/bug671/src/main/java/org/apache/cxf/xjc/bug671/Bug671Plugin.java
Fri Jul 24 13:31:23 2009
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.xjc.bug671;
+
+
+import com.sun.tools.xjc.BadCommandLineException;
+import com.sun.tools.xjc.Options;
+import com.sun.tools.xjc.Plugin;
+import com.sun.xml.bind.api.impl.NameConverter;
+
+/**
+ * Modifies the JAXB code model to handle package naming that run into:
+ * https://jaxb.dev.java.net/issues/show_bug.cgi?id=671
+ */
+public class Bug671Plugin {
+    private Plugin plugin;
+
+    public Bug671Plugin(Plugin p) {
+        plugin = p;
+    }
+    
+    
+    public String getOptionName() {
+        return "Xbug671";
+    }
+
+    public String getUsage() {
+        return "  -Xbug671             : Activate plugin to map package names that contain
keywords\n";
+    }
+
+    public void onActivated(Options opt) throws BadCommandLineException {
+        // kind of a bogus thing to have to do to workaround bug:
+        // https://jaxb.dev.java.net/issues/show_bug.cgi?id=671
+        opt.setNameConverter(new NameConverter.Standard() {
+            @Override
+            public String toPackageName(String nsUri) {
+                String s = super.toPackageName(nsUri);
+                int idx = s.indexOf('.');
+                while (idx != -1) {
+                    ++idx;
+                    int idx2 = s.indexOf('.', idx);
+                    if (idx2 == -1) {
+                        idx2 = s.length();
+                    }
+                    if (!isJavaIdentifier(s.substring(idx, idx2))) {
+                        s = s.substring(0, idx) + "_" + s.substring(idx);
+                    }
+                    idx = s.indexOf('.', idx);
+                }
+                return s;
+            }
+            
+        }, plugin);
+    }
+}

Propchange: cxf/trunk/common/xjc/bug671/src/main/java/org/apache/cxf/xjc/bug671/Bug671Plugin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/common/xjc/bug671/src/main/java/org/apache/cxf/xjc/bug671/Bug671Plugin.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/common/xjc/bug671/src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin
URL: http://svn.apache.org/viewvc/cxf/trunk/common/xjc/bug671/src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin?rev=797442&view=auto
==============================================================================
--- cxf/trunk/common/xjc/bug671/src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin
(added)
+++ cxf/trunk/common/xjc/bug671/src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin
Fri Jul 24 13:31:23 2009
@@ -0,0 +1 @@
+com.sun.tools.xjc.addon.apache_cxf.bug671.Bug671Plugin

Modified: cxf/trunk/common/xjc/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/common/xjc/pom.xml?rev=797442&r1=797441&r2=797442&view=diff
==============================================================================
--- cxf/trunk/common/xjc/pom.xml (original)
+++ cxf/trunk/common/xjc/pom.xml Fri Jul 24 13:31:23 2009
@@ -36,6 +36,7 @@
         <module>dv</module>
         <module>ts</module>
         <module>wsdlextension</module>
+	<module>bug671</module>
         <module>dv-test</module>
         <module>ts-test</module>
         <module>wsdlextension-test</module>

Modified: cxf/trunk/distribution/bundle/all/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/bundle/all/pom.xml?rev=797442&r1=797441&r2=797442&view=diff
==============================================================================
--- cxf/trunk/distribution/bundle/all/pom.xml (original)
+++ cxf/trunk/distribution/bundle/all/pom.xml Fri Jul 24 13:31:23 2009
@@ -102,6 +102,12 @@
             <version>${pom.version}</version>
         </dependency>
         <dependency>
+            <groupId>${pom.groupId}.xjcplugins</groupId>
+            <artifactId>cxf-xjc-bug671</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        
+        <dependency>
             <groupId>${pom.groupId}</groupId>
             <artifactId>cxf-xjc-dv</artifactId>
             <version>${pom.version}</version>

Modified: cxf/trunk/distribution/manifest/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/manifest/pom.xml?rev=797442&r1=797441&r2=797442&view=diff
==============================================================================
--- cxf/trunk/distribution/manifest/pom.xml (original)
+++ cxf/trunk/distribution/manifest/pom.xml Fri Jul 24 13:31:23 2009
@@ -108,7 +108,11 @@
             <artifactId>cxf-xjc-ts</artifactId>
             <version>${pom.version}</version>
         </dependency>
-
+        <dependency>
+            <groupId>${pom.groupId}.xjcplugins</groupId>
+            <artifactId>cxf-xjc-bug671</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
         <dependency>
             <groupId>${pom.groupId}</groupId>
             <artifactId>cxf-api</artifactId>

Modified: cxf/trunk/distribution/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/pom.xml?rev=797442&r1=797441&r2=797442&view=diff
==============================================================================
--- cxf/trunk/distribution/pom.xml (original)
+++ cxf/trunk/distribution/pom.xml Fri Jul 24 13:31:23 2009
@@ -113,7 +113,11 @@
             <artifactId>cxf-xjc-ts</artifactId>
             <version>${pom.version}</version>
         </dependency>
-
+        <dependency>
+            <groupId>${pom.groupId}.xjcplugins</groupId>
+            <artifactId>cxf-xjc-bug671</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
         <dependency>
             <groupId>${pom.groupId}</groupId>
             <artifactId>cxf-api</artifactId>



Mime
View raw message