cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1510701 - in /cxf/branches/2.7.x-fixes: api/src/main/java/org/apache/cxf/common/jaxb/ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/
Date Mon, 05 Aug 2013 20:13:36 GMT
Author: dkulp
Date: Mon Aug  5 20:13:36 2013
New Revision: 1510701

URL: http://svn.apache.org/r1510701
Log:
Merged revisions 1510652 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1510652 | dkulp | 2013-08-05 14:36:30 -0400 (Mon, 05 Aug 2013) | 2 lines

  Don't need to special case eclipselink anymore as the schema based version works.  Don't
need to create an RI based context either.

........

Modified:
    cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
    cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
    cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java

Modified: cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java?rev=1510701&r1=1510700&r2=1510701&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java (original)
+++ cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java Mon
Aug  5 20:13:36 2013
@@ -37,8 +37,6 @@ import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -86,7 +84,6 @@ import org.apache.cxf.common.util.System
 import org.apache.cxf.common.xmlschema.SchemaCollection;
 import org.apache.cxf.helpers.JavaUtils;
 
-
 public final class JAXBUtils {
     
     public enum IdentifierType {
@@ -556,28 +553,6 @@ public final class JAXBUtils {
         return jaxbXjcLoader;
     }
     
-    public static JAXBContext createRIContext(Class<?> clss[], String defaultNS) throws
JAXBException {
-        try {
-            Class<?> cls;
-            Map<String, Object> map = new HashMap<String, Object>();
-            try {
-                cls = Class.forName("com.sun.xml.bind.v2.ContextFactory");
-                if (defaultNS != null) {
-                    map.put("com.sun.xml.bind.defaultNamespaceRemap", defaultNS);
-                }
-            } catch (ClassNotFoundException e) {
-                // TODO Auto-generated catch block
-                cls = Class.forName("com.sun.xml.internal.bind.v2.ContextFactory", true,
getXJCClassLoader());
-                if (defaultNS != null) {
-                    map.put("com.sun.xml.internal.bind.defaultNamespaceRemap", defaultNS);
-                }
-            }
-            Method meth = cls.getMethod("createContext", clss.getClass(), Map.class);
-            return (JAXBContext)meth.invoke(null, clss, map);
-        } catch (Exception e) {
-            throw new JAXBException(e);
-        }
-    }
     public static Object setNamespaceWrapper(final Map<String, String> nspref,
                                            Marshaller marshaller) throws PropertyException
{
         Object mapper = createNamespaceWrapper(marshaller.getClass(), nspref);
@@ -771,7 +746,6 @@ public final class JAXBUtils {
                 return result;
             }
         });
-
         return results;
     }
     

Modified: cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=1510701&r1=1510700&r2=1510701&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Mon Aug  5 20:13:36 2013
@@ -398,20 +398,7 @@ public class JAXBDataBinding extends Abs
                                   r.getSystemId());
             }
 
-            JAXBContext riContext;
-            if (context.getClass().getName().contains("com.sun.xml.")) {
-                riContext = context;
-            } else {
-                // fall back if we're using another jaxb implementation
-                try {
-                    riContext = JAXBUtils.createRIContext(contextClasses
-                        .toArray(new Class[contextClasses.size()]), tns);
-                } catch (JAXBException e) {
-                    throw new ServiceConstructionException(e);
-                }
-            }
-
-            JAXBSchemaInitializer schemaInit = new JAXBSchemaInitializer(serviceInfo, col,
riContext,
+            JAXBSchemaInitializer schemaInit = new JAXBSchemaInitializer(serviceInfo, col,
context,
                                                                          this.qualifiedSchemas,
tns);
             schemaInit.walk();
             if (cachedContextAndSchemas != null && !schemasFromCache) {

Modified: cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java?rev=1510701&r1=1510700&r2=1510701&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
Mon Aug  5 20:13:36 2013
@@ -36,7 +36,6 @@ import javax.wsdl.Definition;
 import javax.wsdl.Service;
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLReader;
-import javax.xml.bind.JAXBContext;
 import javax.xml.stream.XMLEventReader;
 import javax.xml.stream.XMLEventWriter;
 import javax.xml.stream.XMLOutputFactory;
@@ -47,8 +46,6 @@ import org.w3c.dom.Node;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.BindingFactoryManager;
-import org.apache.cxf.common.jaxb.JAXBContextProxy;
-import org.apache.cxf.common.jaxb.JAXBUtils;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.databinding.DataWriter;
@@ -57,8 +54,6 @@ import org.apache.cxf.jaxb.fortest.Quali
 import org.apache.cxf.jaxb.fortest.unqualified.UnqualifiedBean;
 import org.apache.cxf.jaxb.io.DataReaderImpl;
 import org.apache.cxf.jaxb.io.DataWriterImpl;
-import org.apache.cxf.jaxb_misc.ObjectFactory;
-import org.apache.cxf.jaxb_misc.TestJAXBClass;
 import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.wsdl11.WSDLServiceBuilder;
 import org.apache.hello_world_soap_http.types.GreetMe;
@@ -180,16 +175,6 @@ public class JAXBDataBindingTest extends
     }
     
     @Test 
-    public void testJaxbIndex() throws Exception {
-        JAXBDataBinding db = new JAXBDataBinding();
-        Set<Class<?>> classes = new HashSet<Class<?>>();
-        classes.add(ObjectFactory.class);
-        JAXBContext ctx = db.createJAXBContext(classes);
-        JAXBContextProxy ctxp = JAXBUtils.createJAXBContextProxy(ctx);
-        assertNotNull(JAXBSchemaInitializer.getBeanInfo(ctxp, TestJAXBClass.class));
-    }
-    
-    @Test 
     public void testContextProperties() throws Exception {
         JAXBDataBinding db = new JAXBDataBinding();
         Map<String, String> nsMap = new HashMap<String, String>();



Mime
View raw message