Community
Participate
Working Groups
Created attachment 263415 [details] Sample project to reproduce the issue I've attached a sample project to reproduce the issue. Execute run.sh and the following error message should appear: 1. ERROR in /tmp/test/Sample/src/com/test/src/Test.java (at line 0) /* ^ Internal compiler error: java.lang.Exception: java.lang.IllegalArgumentException: element public void set(T) is not a member of the containing type com.test.src.GenericChild<com.test.src.Test.MyTypeChild> nor any of its superclasses at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:169) ---------- 1 problem (1 error) The test calls Types.asMemberOf() to get method "void set(T t)" (defined in GenericSuper<T>) from a parameterized type of a field declared as GenericChild<MyTypeChild>, with public class GenericChild<T extends MyType> extends GenericSuper<T> { } where method is seen as "void set(com.test.src.Test.MyTypeChild)". then areParameterErasuresEqual() fails to find a match. What seemed to work but might not be the right way to fix this, is to change TypesImpl.asMemberOf() from: MethodBinding methodBinding = ((MethodBinding) memberBinding); for (MethodBinding method : typeBinding.methods()) { if (CharOperation.equals(method.selector, methodBinding.selector) && (method.original() == methodBinding || method.areParameterErasuresEqual(methodBinding))) { return TypesImpl.this._env.getFactory().newTypeMirror(method); } } to MethodBinding methodBinding = ((MethodBinding) memberBinding).original(); for (MethodBinding methodG : typeBinding.methods()) { MethodBinding method = methodG.original(); if (CharOperation.equals(method.selector, methodBinding.selector) && (method.original() == methodBinding || method.areParameterErasuresEqual(methodBinding))) { return TypesImpl.this._env.getFactory().newTypeMirror(methodG); } }
Forgot link to switch statement: https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/tree/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.java#n77
(In reply to Jean-Marie HENAFF from comment #1) > Forgot link to switch statement: > > https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/tree/org.eclipse.jdt. > compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl. > java#n77 You probably meant this for bug 510118?
Oops yes sorry, I just noticed it wasn't in the other but report, thanks.
Any plan to get this fixed?
I see that there's already a suggestion for fix, which IMO might be the right way to too. Will see if the effort is small.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.