cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject git commit: Flip back to jettison that works on Java5, but still support the new methods if newer jettison is found
Date Tue, 07 Oct 2014 17:23:03 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.6.x-fixes 2a5237b38 -> 392af4b36


Flip back to jettison that works on Java5, but still support the new
methods if newer jettison is found


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/392af4b3
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/392af4b3
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/392af4b3

Branch: refs/heads/2.6.x-fixes
Commit: 392af4b36edcab9096793c080085392eb5265b36
Parents: 2a5237b
Author: Daniel Kulp <dkulp@apache.org>
Authored: Tue Oct 7 13:16:50 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Tue Oct 7 13:16:50 2014 -0400

----------------------------------------------------------------------
 parent/pom.xml                                         |  2 +-
 .../apache/cxf/jaxrs/provider/json/JSONProvider.java   | 13 +++++++++++--
 .../cxf/jaxrs/provider/json/JSONProviderTest.java      |  1 +
 3 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/392af4b3/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 08ad8fc..de19294 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -120,7 +120,7 @@
         <cxf.jaxb.xjc.version>${cxf.jaxb21.xjc.version}</cxf.jaxb.xjc.version>
 
         <cxf.jdom.version>1.0</cxf.jdom.version>
-        <cxf.jettison.version>1.3.5</cxf.jettison.version>
+        <cxf.jettison.version>1.3.4</cxf.jettison.version>
         <cxf.jetty.osgi.version>[7.2,8.2)</cxf.jetty.osgi.version>
         <cxf.jetty.version>7.5.4.v20111024</cxf.jetty.version>
         <cxf.jibx.version>1.2.4.5</cxf.jibx.version>

http://git-wip-us.apache.org/repos/asf/cxf/blob/392af4b3/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
index 3245c87..70d3770 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
@@ -38,6 +38,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.logging.Level;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.Produces;
@@ -514,13 +515,21 @@ public class JSONProvider<T> extends AbstractJAXBProvider<T>
 {
                                           attributesToElements,
                                           typeConverter);
         if (!dropElementsInXmlStream && super.outDropElements != null) {
-            config.setIgnoredElements(outDropElements);
+            try {
+                config.getClass().getMethod("setIgnoredElements", List.class).invoke(config,
outDropElements);
+            } catch (Throwable t) {
+                LOG.log(Level.WARNING, "Could not set IgnoredElements. Check the Jettison
version.");
+            }
         }
         if (!writeNullAsString) {
             config.setWriteNullAsString(writeNullAsString);
         }
         if (ignoreEmptyArrayValues) {
-            config.setIgnoreEmptyArrayValues(ignoreEmptyArrayValues);
+            try { 
+	        config.getClass().getMethod("setIgnoreEmptyArrayValues", Boolean.TYPE).invoke(config,
ignoreEmptyArrayValues);
+            } catch (Throwable t) {
+                LOG.log(Level.WARNING, "Could not set IgnoreEmptyArrayValues. Check the Jettison
version.");
+            }
         }
         
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/392af4b3/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
index 76ee384..5ff32c9 100644
--- a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
+++ b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
@@ -1016,6 +1016,7 @@ public class JSONProviderTest extends Assert {
     }
     
     @Test
+    @org.junit.Ignore("requires jettison 2.3.5")
     public void testManyTagsEmptyArray() throws Exception {
         JSONProvider<ManyTags> p = new JSONProvider<ManyTags>() {
             protected XMLStreamWriter createWriter(Object actualObject, Class<?> actualClass,



Mime
View raw message