cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1233294 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
Date Thu, 19 Jan 2012 11:38:08 GMT
Author: sergeyb
Date: Thu Jan 19 11:38:08 2012
New Revision: 1233294

URL: http://svn.apache.org/viewvc?rev=1233294&view=rev
Log:
[CXF-4043] One more update to do with ignoreNamespaces and dropRootElement

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java?rev=1233294&r1=1233293&r2=1233294&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
Thu Jan 19 11:38:08 2012
@@ -467,7 +467,7 @@ public class JSONProvider<T> extends Abs
         Type genericType, String enc, OutputStream os, boolean isCollection) throws Exception
{
         
         QName qname = getQName(actualClass, genericType, actualObject, true);
-        if (ignoreNamespaces && isCollection) {        
+        if (ignoreNamespaces && (isCollection  || dropRootElement)) {        
             qname = new QName(qname.getLocalPart());
         }
         if (BADGER_FISH_CONVENTION.equals(convention)) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java?rev=1233294&r1=1233293&r2=1233294&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
Thu Jan 19 11:38:08 2012
@@ -391,6 +391,7 @@ public class JSONProviderTest extends As
     public void testDropRootElement() throws Exception {
         JSONProvider<TagVO2> p = new JSONProvider<TagVO2>();
         p.setDropRootElement(true);
+        p.setIgnoreNamespaces(true);
         Map<String, String> namespaceMap = new HashMap<String, String>();
         namespaceMap.put("http://tags", "ns1");
         p.setNamespaceMap(namespaceMap);



Mime
View raw message