[ 
https://issues.apache.org/jira/browse/CXF-5838?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wei Zhang updated CXF-5838:
---------------------------

    Description: 
I used  @QueryParam to inject a char variable in a method of a resource class:

    @Path("char")
    @GET
    public String getDefault(@QueryParam("letter") char count) {
        return String.valueOf(count);
    }

I don't use @DefaultValue. According to the jaxrs 2.0 API javadoc:

If this annotation is not used and the corresponding meta-data is not present 
in the request, the value will be an empty collection for List, Set or 
SortedSet, null for other object types, and the Java-defined default for 
primitive types. 

So if I access the method without value in the request, I should get the 
Java-defined default value of char -- \u0000, but what I get is "0"



  was:
I used  @QueryParam to inject a char variable in a method of a resource class:

    @Path("char")
    @GET
    public String getDefault(@QueryParam("letter") char count) {
        return String.valueOf(count);
    }

I don't use @DefaultValue. According to the jaxrs 2.0 API javadoc:

If this annotation is not used and the corresponding meta-data is not present 
in the request, the value will be an empty collection for List, Set or 
SortedSet, null for other object types, and the Java-defined default for 
primitive types. 

So if I access the method without value in the request, I should get the 
Java-defined default value of char -- 0x0000, but what I get is "0"




> @QueryParam char return incorrect default value
> -----------------------------------------------
>
>                 Key: CXF-5838
>                 URL: https://issues.apache.org/jira/browse/CXF-5838
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.0
>            Reporter: Wei Zhang
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I used  @QueryParam to inject a char variable in a method of a resource class:
>     @Path("char")
>     @GET
>     public String getDefault(@QueryParam("letter") char count) {
>         return String.valueOf(count);
>     }
> I don't use @DefaultValue. According to the jaxrs 2.0 API javadoc:
> If this annotation is not used and the corresponding meta-data is not present 
> in the request, the value will be an empty collection for List, Set or 
> SortedSet, null for other object types, and the Java-defined default for 
> primitive types. 
> So if I access the method without value in the request, I should get the 
> Java-defined default value of char -- \u0000, but what I get is "0"



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to