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

Bug 338357

Summary: Detail Formatter reports Evaluations must contain either an expression or a block of well-formed statements on Generic Methods
Product: [Eclipse Project] JDT Reporter: Alessandro Carraro <carraro.alessandro>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: 3.6.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Alessandro Carraro CLA 2011-02-27 16:07:12 EST
Build Identifier: 20100917-0705

I'm sorry I've not the experience to produce a JUnit test Class, I try with an example.

Detail Formatters always fail when we have:
1) A generic type with a generic method
2) The generic method type parameter is called with the same name as the class' formal type parameter
3) The type parameter of the generic method is bound (extends something)

Example class:
public class TestDetailFormatter<X> {
	public static void main(String[] args) {
		TestDetailFormatter<Object> local = new TestDetailFormatter<Object>();
		System.out.println(local);
	}
	static <X extends Object> void errMethod(){}
}

Workaround:
if the name of the type parameter is different from the formal type parameter, there is no problem (in the example class changing the signature of errMethod with the equivalent 

static <Y extends Object> void errMethod

resolves the problem)

Reproducible: Always

Steps to Reproduce:
1. Create a class type as described in the detail of this bug report
2. Create a detail formatter for this type (any detail formatter will throw the error)
3. Debug putting a breakpoint in the last line of the main method
Comment 1 Michael Rennie CLA 2015-03-05 17:46:56 EST
this was fixed with bug 341232.

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