Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338357 - Detail Formatter reports Evaluations must contain either an expression or a block of well-formed statements on Generic Methods
Summary: Detail Formatter reports Evaluations must contain either an expression or a b...
Status: CLOSED DUPLICATE of bug 341232
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-27 16:07 EST by Alessandro Carraro CLA
Modified: 2015-03-05 17:46 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***