cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1162907 - in /cxf/branches/2.4.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
Date Mon, 29 Aug 2011 17:22:40 GMT
Author: sergeyb
Date: Mon Aug 29 17:22:40 2011
New Revision: 1162907

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

........
  r1162904 | sergeyb | 2011-08-29 18:19:29 +0100 (Mon, 29 Aug 2011) | 1 line
  
  [CXF-3760] Setting Accept:*/* in case of void
........

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/client/ClientProxyImpl.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Aug 29 17:22:40 2011
@@ -1 +1 @@
-/cxf/trunk:1162268,1162276
+/cxf/trunk:1162268,1162276,1162904

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/client/ClientProxyImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java?rev=1162907&r1=1162906&r2=1162907&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
Mon Aug 29 17:22:40 2011
@@ -299,11 +299,18 @@ public class ClientProxyImpl extends Abs
         
         List<MediaType> accepts = getAccept(headers);
         if (accepts == null) {
-            accepts = InjectionUtils.isPrimitive(responseClass) 
-                ? Collections.singletonList(MediaType.TEXT_PLAIN_TYPE)
-                : ori.getProduceTypes().size() == 0 
-                || ori.getProduceTypes().get(0).equals(MediaType.WILDCARD_TYPE) 
-                ? Collections.singletonList(MediaType.APPLICATION_XML_TYPE) : ori.getProduceTypes();
+            boolean produceWildcard = ori.getProduceTypes().size() == 0 
+                || ori.getProduceTypes().get(0).equals(MediaType.WILDCARD_TYPE);
+            if (produceWildcard) {
+                accepts = InjectionUtils.isPrimitive(responseClass)
+                    ? Collections.singletonList(MediaType.TEXT_PLAIN_TYPE)
+                    : Collections.singletonList(MediaType.APPLICATION_XML_TYPE);        
+            } else if (responseClass == Void.class) {
+                accepts = Collections.singletonList(MediaType.WILDCARD_TYPE);
+            } else {
+                accepts = ori.getProduceTypes();
+            }
+            
             for (MediaType mt : accepts) {
                 headers.add(HttpHeaders.ACCEPT, mt.toString());
             }



Mime
View raw message