Project: JDT
Bug 357325 [render] Method parameter annotations are not shown in Javadoc hover/view
Reported: 2011-09-11 08:15:28 | Status: verified fixed

Build Identifier: 3.7.1 or any previous 3.5 - 3.7 builds AS IS: Given the example class below, javadoc hover shown for both methods (toString()/main()) does NOT include parameter annotations information. ################################# import static java.lang.annotation.ElementType.*; import java.lang.annotation.*; public class TestParameterAnnotations { @NonNull String x; /** * @param y any * @return given value as string or empty string */ @NonNull public String toString(@NonNull Object y) { return y != null ? y.toString() : ""; } /** * @param args any parameters */ public static void main(@NonNull String[] args) { String s = new TestParameterAnnotations().toString(null); System.err.println(s); } } @Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE}) @Retention(RetentionPolicy.CLASS) @interface NonNull { } ###################################### TO BE: As annotations like above are often very important for the code documentation, they should be shown for method parameters. Interestingly, method return value annotation and class field annotations are shown in the javadoc hover/view. Reproducible: Always

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/JavaElementLabelsTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/infoviews/JavadocView.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavadocHover.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLabelComposer.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabels.java