[jira] [Work logged] (CXF-7966) Beanspector throws IllegalArgumentException when dealing with overridden methods

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Work logged] (CXF-7966) Beanspector throws IllegalArgumentException when dealing with overridden methods

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/CXF-7966?focusedWorklogId=196238&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-196238 ]

ASF GitHub Bot logged work on CXF-7966:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Feb/19 14:38
            Start Date: 08/Feb/19 14:38
    Worklog Time Spent: 10m
      Work Description: mrulli commented on pull request #510: Fix CXF-7966: allows more flexibility in Beanspector
URL: https://github.com/apache/cxf/pull/510
 
 
   Signed-off Matteo Rulli <[hidden email]>
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 196238)
            Time Spent: 10m
    Remaining Estimate: 0h

> Beanspector throws IllegalArgumentException when dealing with overridden methods
> --------------------------------------------------------------------------------
>
>                 Key: CXF-7966
>                 URL: https://issues.apache.org/jira/browse/CXF-7966
>             Project: CXF
>          Issue Type: Improvement
>            Reporter: matteo rulli
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Let's consider the following pojos: 
> {code:java}
> public class A { 
>         private String value; 
>         public String getValue()\{ ... } 
>         public void setValue(String value) \{ ... } 
> } 
> public class B { 
>         
>         private A aValue; 
>         public A getAValue()\{ ... } 
>         public void setAValue(A avalue) \{ ... } 
> } 
> {code}
> And assume one extends these pojos and decorates them with JPA annotations. 
> To leverage CXF org.apache.cxf.jaxrs.ext.search.SearchContext and JPACriteriaQueryVisitor as explained in the docs ([http://cxf.apache.org/docs/jax-rs-search.html#JAX-RSSearch-JPA2.0]) and perform searches like 
> {code:java}
> _s=aValue==*search token* {code}
> in OpenJPA one has to override the EntityB.getAValue as follows: 
> {code:java}
> @Entity 
> // ... other JPA annotations are omitted 
> public class EntityB extends B { 
>         
>         @Override 
>         // We need to specialize return type to EntityA to make SearchContext work 
>         public EntityA getAValue()\{ ... } 
>         // This method definition is needed to avoid java.lang.VerifyError from JPA provider 
>         public void setAValue(EntityA avalue) \{ ... } 
> } 
> {code}
> But with this scenario, the current implementation of org.apache.cxf.jaxrs.ext.search.Beanspector<T> fails, throwing IllegalArgumentException: Accessor 'aValue' type mismatch, getter type is X while setter type is Y, X and Y depending on the order of the EntityB's methods as returned by the Class.getMethods(). 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)