[forge-issues] [JBoss JIRA] (ROASTER-121) Overridden interface has wrong signature

plamen petkov (JIRA) issues at jboss.org
Wed Feb 22 03:35:00 EST 2017


    [ https://issues.jboss.org/browse/ROASTER-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13367284#comment-13367284 ] 

plamen petkov edited comment on ROASTER-121 at 2/22/17 3:34 AM:
----------------------------------------------------------------

If you give me a couple of pointers, I'll be glad to take a look and fix this issue. Because you are working with JDT under the hood, I was looking through the "[addUnimplementedMethods|https://github.com/eclipse/eclipse.jdt.ui/blob/89da2ef66b1fced4c1d4ff81ea9622ada9841256/org.eclipse.jdt.ui/core%20extension/org/eclipse/jdt/internal/corext/fix/AddUnimplementedMethodsOperation.java#L67]" implementation that eclipse is using and if I might be able to figure out how to move the logic


was (Author: plamen5kov):
If you give me a couple of pointers, I'll be glad to take a look and fix this issue. Because you are working with JDT under the hood, I was looking through the "[addUnimplementedMethods|https://github.com/eclipse/eclipse.jdt.ui/blob/89da2ef66b1fced4c1d4ff81ea9622ada9841256/org.eclipse.jdt.ui/core%20extension/org/eclipse/jdt/internal/corext/fix/AddUnimplementedMethodsOperation.java#L67]" implementation and if I might be able to figure out how to move the logic

> Overridden interface has wrong signature
> ----------------------------------------
>
>                 Key: ROASTER-121
>                 URL: https://issues.jboss.org/browse/ROASTER-121
>             Project: Roaster
>          Issue Type: Bug
>          Components: JDT
>    Affects Versions: 2.19.4.Final
>            Reporter: plamen petkov
>
> When you implement an interface that extends another interface that has generic parameters, these parameters are not taken into account, when generating the signature of the overridden method. Will explain more in the steps to reproduce.
> Having:
> {code:java}
> abstract class A {
>   public interface Iface1<T extends A> {
>     void doSomething(T smth);
>   }
> }
> public classs C {
>   public interface Iface2 extends A.Iface1<C.D> {
>   }
>   public class D extends A{
>   }
> }
> {code}
> Now when we implement C.Iface2 we should get the method with signature:
> _public void doSomething(C.D smth)_,
> as C.D is specified for the generic type, but instead we get:
> _public void doSomething(A smth)_
> which is wrong because class A is abstract for one, and type erasure was not done right because otherwise the method signature would have the right type of parameters.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the forge-issues mailing list