cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1156185 - in /cxf/branches/2.4.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
Date Wed, 10 Aug 2011 13:52:08 GMT
Author: sergeyb
Date: Wed Aug 10 13:52:07 2011
New Revision: 1156185

URL: http://svn.apache.org/viewvc?rev=1156185&view=rev
Log:
Merged revisions 1156183 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1156183 | sergeyb | 2011-08-10 14:50:08 +0100 (Wed, 10 Aug 2011) | 1 line
  
  [CXF-3719] Checking for null OutputStream
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:1156183

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java?rev=1156185&r1=1156184&r2=1156185&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
Wed Aug 10 13:52:07 2011
@@ -294,6 +294,15 @@ public class JSONProvider extends Abstra
     public void writeTo(Object obj, Class<?> cls, Type genericType, Annotation[] anns,
 
         MediaType m, MultivaluedMap<String, Object> headers, OutputStream os)
         throws IOException {
+        if (os == null) {
+            StringBuilder sb = new StringBuilder();
+            sb.append("Jettison needs initialized OutputStream");
+            if (getContext() != null && getContext().getContent(XMLStreamWriter.class)
== null) {
+                sb.append("; if you need to customize Jettison output with the custom XMLStreamWriter"
+                          + " then extend JSONProvider or when possible configure it directly.");
+            }
+            throw new IOException(sb.toString());
+        }
         try {
             
             String encoding = HttpUtils.getSetEncoding(m, headers, "UTF-8");



Mime
View raw message