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

Brad Cupit updated CXF-2986:
----------------------------

    Description: 
when using @QueryParam on a collection and the query param is not found in the 
request, CXF sets a null collection, rather than an empty collection.

The javadocs in @DefaultValue says:
If this annotation is not used and the corresponding metadata is not present in 
the request, the value will be an empty collection for List, Set or SortedSet

this seems similar to CXF-1675

Example:
    @GET
    @Path("/stuff")
    public Response get(@QueryParam("option") Set<String> options) { ... }

and http://localhost:8080/stuff is called (and ?option=abc is not on the query 
string), options will be null, but should be an empty Set

  was:
when using @QueryParam on a collection and the query param is not found in the 
request, CXF sets a null collection, rather than an empty collection.

The javadocs in @DefaultValue says:
If this annotation is not used and the corresponding metadata is not present in 
the request, the value will be an empty collection for List, Set or SortedSet

this seems similar to CXF-1675

Example:
    @GET
    @Path("/stuff")
    public Response get(@QueryParam("option") Set<String> options) { ... }

and http://localhost:8080/stuff is called (and ?option=abc is not on the query 
string), options will be null, rather than an empty Set


> sets null instead of empty List/Set/SortedSet when value isn't in query string
> ------------------------------------------------------------------------------
>
>                 Key: CXF-2986
>                 URL: https://issues.apache.org/jira/browse/CXF-2986
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.2.10
>            Reporter: Brad Cupit
>            Priority: Minor
>
> when using @QueryParam on a collection and the query param is not found in 
> the request, CXF sets a null collection, rather than an empty collection.
> The javadocs in @DefaultValue says:
> If this annotation is not used and the corresponding metadata is not present 
> in the request, the value will be an empty collection for List, Set or 
> SortedSet
> this seems similar to CXF-1675
> Example:
>     @GET
>     @Path("/stuff")
>     public Response get(@QueryParam("option") Set<String> options) { ... }
> and http://localhost:8080/stuff is called (and ?option=abc is not on the 
> query string), options will be null, but should be an empty Set

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to