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

Bug 418413

Summary: [javadoc] Annotation on type declaration not shown on hovering over it in anonymous class declaration
Product: [Eclipse Project] JDT Reporter: Noopur Gupta <noopur_gupta>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.4   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Noopur Gupta CLA 2013-10-01 07:45:50 EDT
package misc.test;

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

@Target(ElementType.TYPE)
@interface A {
}

/**
 * hello
 */
@A
interface MyInterface {
}

class N implements MyInterface { // [1] hover over "MyInterface"
	MyInterface m= new MyInterface() { // [2] hover over "MyInterface" (Annotation on type declaration is not shown)
	};
}
// ------------------------------

In the above example, hover over "MyInterface" at [1] and [2].

On hovering at [2], the annotation "@A" is not shown in the javadoc hover.
However, the annotation is shown in the "Javadoc view" for "MyInterface" at [2].

It is also shown at [1] on both hovering and in the view.

The same issue exists for the @FunctionalInterface annotation added on java.util.Comparator in Java 8 for a similar example, where the annotation is not shown on hovering at the anonymous class declaration:

void foo() {
		List<String> strs = new ArrayList<>();
		Collections.sort(strs, new Comparator<String>() { // [3]
					public int compare(String x, String y) {
						return x.compareTo(y);
					}
				});
	}
Comment 1 Eclipse Genie CLA 2019-11-05 12:02:53 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.