You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2011/08/29 19:25:36 UTC

svn commit: r1162908 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java

Author: sergeyb
Date: Mon Aug 29 17:25:35 2011
New Revision: 1162908

URL: http://svn.apache.org/viewvc?rev=1162908&view=rev
Log:
Merged revisions 1162907 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.4.x-fixes

................
  r1162907 | sergeyb | 2011-08-29 18:22:40 +0100 (Mon, 29 Aug 2011) | 9 lines
  
  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.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Mon Aug 29 17:25:35 2011
@@ -0,0 +1,2 @@
+/cxf/branches/2.4.x-fixes:1162907
+/cxf/trunk:1162904

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

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java?rev=1162908&r1=1162907&r2=1162908&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java (original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java Mon Aug 29 17:25:35 2011
@@ -292,11 +292,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());
             }