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

Bug 437476

Summary: Type Hierarchy not showing anonymous class as implementation of interface
Product: [Eclipse Project] JDT Reporter: Noopur Gupta <noopur_gupta>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: critical    
Priority: P3 CC: daniel_megert, manju656, markus.kell.r
Version: 4.4   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Noopur Gupta CLA 2014-06-15 07:13:02 EDT
package java8;

@SuppressWarnings("unused")
public class C {

	private void method() {
		FI fi1 = () -> -1;

		FI fi2 = new FI() {
			@Override
			public int foo() {
				return -1;
			}
		};

	}
}

class FIImpl implements FI {
	@Override
	public int foo() {
		return 0;
	}
}

@FunctionalInterface
interface FI {
	int foo();
}
-------------------------------------------------

Press Ctrl+T to view the type hierarchy of FI at the interface declaration.
Only FIImpl and lambda are shown. The anonymous class 'fi2' is not shown in the hierarchy.

This was working earlier for ECNA with Kepler SR2 and Java 8 patch 1.0.0.v20140317-1956.
Comment 1 Noopur Gupta CLA 2014-06-15 07:37:43 EDT
It works if 'fi2' is a field instead of a local variable.
Comment 2 Martin Mathew CLA 2014-06-17 05:48:23 EDT
If we comment the lambda expression in #method then the Type Hierarchy shows the anonymous class implementation also.

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