Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 390714

Summary: Generics interface method undefined
Product: [Eclipse Project] JDT Reporter: Preethum Prithviraj <p.prith>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: p.prith, samrat.dhillon
Version: 4.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Preethum Prithviraj CLA 2012-09-28 12:57:26 EDT
JDT fails to locate methods for generics when generics are defined as extending another class. For Ex:

public class Test<T extends Comparable<T>>{

    T val;

    public void test(T val2){
        val.compareTo(val2); // BP
    }
}

In this method, if a breakpoint is applied at the compareTo line (at BP), attempting to evaluate an expression in the debugger using the compareTo method results in the following error:

The method compareTo(T) is undefined for the type T.

The debugger is not accounting for that fact that in this class, T is defined as extending the Comparable<T> interface, and therefore T.compareTo(T) is defined.
Comment 1 Samrat Dhillon CLA 2013-01-31 22:21:22 EST
This bug seems to have been caused as a side effect of fixing Bug 245007, specifically in org.eclipse.jdt.internal.compiler.ast.MessageSend. If the fix is removed from MessageSend class, then the evaluation happens without any problem.
Comment 2 Eclipse Genie CLA 2018-11-09 18:51:13 EST
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.