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

Bug 332002

Summary: Cannot inspect or watch variable values in generic classes
Product: [Eclipse Project] JDT Reporter: Missing name <luca.dragon>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: Michael_Rennie
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Eclipse Project Test Case none

Description Missing name CLA 2010-12-07 06:41:59 EST
Build Identifier: 20100917-0705

Trying to inspect even a simple variable in a double generic class fails. With "double generic class" I mean a class with two type parameters - haven't tried with 3 or more..
Inspector says: "Evaluations must contain either an expression or a block of well-formed statements"
I have found no workaround for this..

Reproducible: Always

Steps to Reproduce:
Run this sample program Main, built using the following classes:

public class Main {

	public static void main(String[] args) {
		GenericClassProcessor<T1, T2> proc = new GenericClassProcessor<T1, T2>();
		GenericClass<T1, T2> processedItem = new GenericClass<T1, T2>();
		proc.process(processedItem);
	}
}


public class GenericClassProcessor<AA extends I1, BB extends I2> implements GenericInterface<AA, BB> {

	@Override
	public void process(GenericClass<AA, BB> anInstance) {
		int i = 0;
		System.out.println("i = " + i);
		System.out.println(" ---- set breakpoint here ---- and try to inspect variables ---- ");
	}
}


public class GenericClass<AA extends I1, BB extends I2> {

}


public interface GenericInterface<AA extends I1, BB extends I2> {

	public void process(GenericClass<AA, BB> anInstance);
	
}


public interface I1 {

}


public interface I2 {

}


public class T1 implements I1 {

}


public class T2 implements I2 {

}
Comment 1 Missing name CLA 2011-08-17 15:47:07 EDT
Created attachment 201667 [details]
Eclipse Project Test Case

Eclipse Helios Project with Test Case reproducing the bug as described.

Set breakpoint where indicated in class GenericClassProcessor and try to inspect (Ctrl+Shift+I) variables at that point. Every inspects fails, both on simple and generic variables.
Comment 2 Michael Rennie CLA 2011-08-22 14:08:50 EDT
I originally thought this would be the same duplicate parameter issue as bug 344856, but with this example snippet we are ending up with the following errors:

1. [Pb(526) Bound mismatch: The type AA is not a valid substitute for the bounded parameter <AA extends I1> of the type GenericClass<AA,BB>
2.Pb(526) Bound mismatch: The type BB is not a valid substitute for the bounded parameter <BB extends I2> of the type GenericClass<AA,BB>]
Comment 3 Michael Rennie CLA 2013-02-28 16:44:10 EST
The patch for bug 341232 also fixes this bug, marking as a dupe

*** This bug has been marked as a duplicate of bug 341232 ***