[ 
https://issues.apache.org/jira/browse/CXF-6185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14274687#comment-14274687
 ] 

Xu ShiChang Desmond commented on CXF-6185:
------------------------------------------

Daniel, the way the Client policies work is that one can choose to 'Not 
specify' properties when one does not particularly care about those properties. 
By choosing not to specify the allowChunking property in p2, I am in effect 
saying 'I do not care whether chunking is enabled or not' - I am not saying 
that I am insisting that chunking must be allowed.

For example, 
HTTPClientPolicy p1 = new HTTPClientPolicy();
HTTPClientPolicy p2 = new HTTPClientPolicy();
p1.setAccept("application/whatever");
and now, new ClientPolicyCalculator().compatible(p1, p2) returns true because 
p2 did not specify any 'accept'.

This bug is affecting allowChunking, and also similarly affecting autoRedirect

> cxf org.apache.cxf.transport.http.policy.impl.ClientPolicyCalculator
> --------------------------------------------------------------------
>
>                 Key: CXF-6185
>                 URL: https://issues.apache.org/jira/browse/CXF-6185
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 3.0.2
>            Reporter: Xu ShiChang Desmond
>         Attachments: ClientPolicyCalculator.java
>
>
> org.apache.cxf.transport.http.policy.impl.ClientPolicyCalculator.compatible(HTTPClientPolicy
>  p1, HTTPClientPolicy p2)'s intention is to return true unless there is a 
> property someProp which is specified in both policies and having different 
> values. For the property allowChunking though, it simply does 
> p1.isAllowChunking() == p2.isAllowChunking().
> However HTTPClientPolicy.isAllowChunking returns a boolean and defaults to 
> 'true' if unspecified.
> Given two client policies, one where allowChunking is specified to be false, 
> while unspecified in the other policy is thus not handled correctly as 
> intended, the autoRedirect property also looks to be suffering the same 
> symptom as allowChunking.
> Simple test case reproduces this problem:
>   HTTPClientPolicy p1 = new HTTPClientPolicy();
>   HTTPClientPolicy p2 = new HTTPClientPolicy();
>   p1.setAllowChunking(false);
>   Assert.assertTrue(new ClientPolicyCalculator().compatible(p1, p2));



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to