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

Peter Keller commented on XMLBEANS-609:
---------------------------------------

In my hands, the attached file "609.patch" fixes the issue: the difference in 
the generated code before and after is:

{{diff -ru build2/java/com/example/easypo/impl/ProductTypeImpl.java 
build/java/com/example/easypo/impl/ProductTypeImpl.java}}
{{--- build2/java/com/example/easypo/impl/ProductTypeImpl.java    2022-06-01 
16:17:58.363935939 +0100}}
{{+++ build/java/com/example/easypo/impl/ProductTypeImpl.java    2022-06-01 
16:18:18.239843488 +0100}}
{{@@ -26,7 +26,7 @@}}
{{     /**}}
{{      * Implementation method for interface mypackage.ProductFooHandler}}
{{      */}}
{{-    public T getFoo(java.lang.Class<T> type) {}}
{{+    public  <T extends String> T getFoo(java.lang.Class<T> type) {}}
{{         return mypackage.ProductFooHandler.getFoo(this, type);}}

This is a rather superficial fix of course, and there are more complex cases 
that this probably won't work for, but a more general solution should wait for 
a future release, I guess rather than holding up the release of 5.1.0

> Parameterised return types not handled correctly in interface extensions
> ------------------------------------------------------------------------
>
>                 Key: XMLBEANS-609
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-609
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Binding
>            Reporter: Peter Keller
>            Priority: Major
>             Fix For: Version 5.1.0
>
>         Attachments: 609.patch, xmlbeans-ie-generic.tar
>
>
> The attached test case fails because of the parameterised return type of the 
> interface extension method:
> {{/home/pkeller/Projects/Workflow/xmlbeans-upgrade/xmlbeans-ie-generic/build/java/com/example/easypo/impl/ProductTypeImpl.java:29:
>  error: cannot find symbol
>     public T getFoo(java.lang.Class<T> type) {
>                                     ^
>   symbol:   class T
>   location: class ProductTypeImpl
> /home/pkeller/Projects/Workflow/xmlbeans-upgrade/xmlbeans-ie-generic/build/java/com/example/easypo/impl/ProductTypeImpl.java:29:
>  error: cannot find symbol
>     public T getFoo(java.lang.Class<T> type) {
>            ^
>   symbol:   class T
>   location: class ProductTypeImpl
> 2 errors}}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to