Community
Participate
Working Groups
Build ID: I20080617-2000 Steps To Reproduce: 1.In the following code class A<T> { void a(T t){} } class B extends A<String> { public void m() { super.a(null); super.a(new String()); } } 2. pull up B.m() to class A 3. Refactoring engine produces the following code class A<T> { void a(T t){} public void m() { this.a(null); this.a(new String()); } } class B extends A<String> { } 4. "this.a(new String());" causes a compile error More information: When I pull up B.m() to class A, output causes a compile error from ¡°this.a(new String());¡±. From the original test code, Parameter type of method A.a() is set to String because class B is inherited from A<String>. However, in the test output, Type T for the parameter of A.a() is not set yet. Thus, new String() need to be casted by T. Although, it is not safe in many cases, the refactoring engine has the bug. Expected output: package p; class A<T> { void a(T t){} public void m() { this.a(null); this.a((T) new String()); } } class B extends A<String> { }
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.