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

Andriy Redko commented on CXF-8624:
-----------------------------------

The JAXB spec [1] is a best place to have the support for JSR 310, the 
[threeten-jaxb|https://github.com/threeten-jaxb/threeten-jaxb] seems to be 
filling this gap at the moment. 

[1] https://github.com/eclipse-ee4j/jaxb-ri/issues/1174

> CXF Extension @QueryParam("") does not parse correctly LocalDate in the bean
> ----------------------------------------------------------------------------
>
>                 Key: CXF-8624
>                 URL: https://issues.apache.org/jira/browse/CXF-8624
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.3.12, 3.4.5
>            Reporter: Anthony Durussel
>            Assignee: Andriy Redko
>            Priority: Major
>
> If you use the @QueryParam("") extension on a method parameter:
> {code:java}
> public void foo(@QueryParam("") Bar bar);
> {code}
> with Bar class equals to :
> {code:java}
> public class Bar  {
>     private LocalDate date;
> } {code}
> The URL generate from the following method parse the localDate as a standard 
> object instead of singleValue as it's done for standard java.util.date
> {code:java}
> org.apache.cxf.jaxrs.utils.InjectionUtils.fillInValuesFromBean(Object, 
> String, MultivaluedMap<String, Object>)
> {code}
> {code:java}
> if (isPrimitive(value.getClass()) || 
> Date.class.isAssignableFrom(value.getClass())) {
>     values.putSingle(propertyName, value);
> } else if (value.getClass().isEnum()) {
>     values.putSingle(propertyName, value.toString());
> } else if (isSupportedCollectionOrArray(value.getClass())) {
>     final List<Object> theValues;
>     if (value.getClass().isArray()) {
>         theValues = Arrays.asList((Object[])value);
>     } else if (value instanceof Set) {
>         theValues = new ArrayList<>((Set<?>)value);
>     } else {
>         theValues = CastUtils.cast((List<?>)value);
>     }
>     values.put(propertyName, theValues);
> } else if (Map.class.isAssignableFrom(value.getClass())) {
>     if (isSupportedMap(m.getGenericReturnType())) {
>         Map<Object, Object> map = CastUtils.cast((Map<?, ?>)value);
>         for (Map.Entry<Object, Object> entry : map.entrySet()) {
>             values.add(propertyName + '.' + entry.getKey().toString(),
>                     entry.getValue().toString());
>         }
>     }
> } else {
>     fillInValuesFromBean(value, propertyName, values);
> }{code}
> Ideally, we should add the LocalDate in the first "if condition" to handle it 
> correctly



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to