cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1400213 - in /cxf/trunk: parent/pom.xml tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Date Fri, 19 Oct 2012 18:37:10 GMT
Author: dkulp
Date: Fri Oct 19 18:37:10 2012
New Revision: 1400213

URL: http://svn.apache.org/viewvc?rev=1400213&view=rev
Log:
Updates to support the latest JAXB impl

Modified:
    cxf/trunk/parent/pom.xml
    cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java

Modified: cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/parent/pom.xml?rev=1400213&r1=1400212&r2=1400213&view=diff
==============================================================================
--- cxf/trunk/parent/pom.xml (original)
+++ cxf/trunk/parent/pom.xml Fri Oct 19 18:37:10 2012
@@ -89,8 +89,8 @@
         <cxf.jaxb21.impl.version>2.1.13</cxf.jaxb21.impl.version>
         <cxf.jaxb21.xjc.version>2.1.13</cxf.jaxb21.xjc.version>
         <cxf.jaxb22.version>2.2.6</cxf.jaxb22.version>
-        <cxf.jaxb22.impl.version>2.2.5</cxf.jaxb22.impl.version>
-        <cxf.jaxb22.xjc.version>2.2.5</cxf.jaxb22.xjc.version>
+        <cxf.jaxb22.impl.version>2.2.6</cxf.jaxb22.impl.version>
+        <cxf.jaxb22.xjc.version>2.2.6</cxf.jaxb22.xjc.version>
 
         <!-- by default, we use jaxb 2.1, but java5 profile will override to 2.2 -->
         <cxf.jaxb.version>${cxf.jaxb21.version}</cxf.jaxb.version>

Modified: cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?rev=1400213&r1=1400212&r2=1400213&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
(original)
+++ cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Fri Oct 19 18:37:10 2012
@@ -23,6 +23,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Writer;
+import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.net.URI;
 import java.net.URL;
@@ -86,6 +87,7 @@ import com.sun.tools.xjc.api.TypeAndAnno
 import com.sun.tools.xjc.api.XJC;
 import com.sun.tools.xjc.reader.internalizer.AbstractReferenceFinderImpl;
 import com.sun.tools.xjc.reader.internalizer.DOMForest;
+import com.sun.tools.xjc.reader.internalizer.InternalizationLogic;
 import com.sun.tools.xjc.reader.xmlschema.parser.LSInputSAXWrapper;
 import com.sun.tools.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic;
 
@@ -303,7 +305,10 @@ public class JAXBDataBinding implements 
         SchemaCompiler schemaCompiler = XJC.createSchemaCompiler();
         Bus bus = context.get(Bus.class);
         OASISCatalogManager catalog = bus.getExtension(OASISCatalogManager.class);
-        hackInNewInternalizationLogic(schemaCompiler, catalog);
+
+        Options opts = null;
+        opts = getOptions(schemaCompiler);
+        hackInNewInternalizationLogic(schemaCompiler, catalog, opts);
 
         ClassCollector classCollector = context.get(ClassCollector.class);
 
@@ -319,8 +324,6 @@ public class JAXBDataBinding implements 
         List<InputSource> jaxbBindings = context.getJaxbBindingFile();
         SchemaCollection schemas = (SchemaCollection) context.get(ToolConstants.XML_SCHEMA_COLLECTION);
 
-        Options opts = null;
-        opts = getOptions(schemaCompiler);
 
         List<String> args = new ArrayList<String>();
 
@@ -463,16 +466,27 @@ public class JAXBDataBinding implements 
         }
     }
     private void hackInNewInternalizationLogic(SchemaCompiler schemaCompiler,
-                                               final OASISCatalogManager catalog) {
+                                               final OASISCatalogManager catalog,
+                                               Options opts) {
         try {
             Field f = schemaCompiler.getClass().getDeclaredField("forest");
             f.setAccessible(true);
-            DOMForest forest = new DOMForest(new XMLSchemaInternalizationLogic() {
+            XMLSchemaInternalizationLogic logic = new XMLSchemaInternalizationLogic() {
                 public XMLFilterImpl createExternalReferenceFinder(DOMForest parent) {
                     return new ReferenceFinder(parent, catalog);
                 }
+            };
+            
+            Constructor<DOMForest> c = null;
+            DOMForest forest = null;
 
-            });
+            try {
+                c = DOMForest.class.getConstructor(InternalizationLogic.class, Options.class);
+                forest = c.newInstance(logic, opts);
+            } catch (Throwable t) {
+                c = DOMForest.class.getConstructor(InternalizationLogic.class);
+                forest = c.newInstance(logic);
+            }
             forest.setErrorHandler((ErrorReceiver)schemaCompiler);
             f.set(schemaCompiler, forest);
         } catch (Throwable ex)  {



Mime
View raw message