cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-7368] Ignoring some well known types
Date Fri, 12 May 2017 10:06:54 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 6c0621385 -> 87de3b013


[CXF-7368] Ignoring some well known types


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

Branch: refs/heads/3.0.x-fixes
Commit: 87de3b01377060f5a11575b44c78e5a08c736d93
Parents: 6c06213
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Fri May 12 10:59:09 2017 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Fri May 12 11:06:37 2017 +0100

----------------------------------------------------------------------
 .../apache/cxf/jaxrs/provider/AbstractJAXBProvider.java  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/87de3b01/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
index 64a1e07..144682d 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
@@ -39,6 +39,7 @@ import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
+import javax.ws.rs.core.StreamingOutput;
 import javax.ws.rs.ext.ContextResolver;
 import javax.ws.rs.ext.MessageBodyReader;
 import javax.ws.rs.ext.MessageBodyWriter;
@@ -89,8 +90,10 @@ public abstract class AbstractJAXBProvider<T> extends AbstractConfigurableProvid
     protected static final String NS_MAPPER_PROPERTY_RI_INT = "com.sun.xml.internal.bind.namespacePrefixMapper";
     private static final String JAXB_DEFAULT_NAMESPACE = "##default";
     private static final String JAXB_DEFAULT_NAME = "##default";
-    
-    
+    private static final Set<Class<?>> UNSUPPORTED_CLASSES = 
+        new HashSet<Class<?>>(Arrays.asList(InputStream.class,
+                                            OutputStream.class,
+                                            StreamingOutput.class));
     protected Set<Class<?>> collectionContextClasses = new HashSet<Class<?>>();
     
     protected Map<String, String> jaxbElementClassMap = Collections.emptyMap();
@@ -331,7 +334,6 @@ public abstract class AbstractJAXBProvider<T> extends AbstractConfigurableProvid
                 return false;
             }
         }
-        
         return marshalAsJaxbElement && (!xmlTypeAsJaxbElementOnly || isXmlType(type))

             || isSupported(type, genericType, anns);
     }
@@ -562,6 +564,9 @@ public abstract class AbstractJAXBProvider<T> extends AbstractConfigurableProvid
             || isSkipJaxbChecks()) {
             return true;
         }
+        if (UNSUPPORTED_CLASSES.contains(type)) {
+            return false;
+        }
         return isXmlRoot(type)
             || JAXBElement.class.isAssignableFrom(type)
             || objectFactoryOrIndexAvailable(type)


Mime
View raw message