| Summary: | [render] Method parameter annotations are not shown in Javadoc hover/view | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Andrey Loskutov <loskutov> |
| Component: | UI | Assignee: | Markus Keller <markus.kell.r> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | deepakazad, markus.kell.r, raksha.vasisht, stephan.herrmann |
| Version: | 3.8 | Keywords: | api |
| Target Milestone: | 3.8 M4 | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
Yes, we need to add these. They also show up in generated Javadoc, but only if you add @Documented to NonNull. We currently show all annotations in the hovers, and I think we should keep it that way. Needs new API in JavaElementLabels, since we shouldn't add this in all labels. Fixed in master with commit b441737900fbbd3fe2346d6c05daa02ec061f6c1. Verified for Juno M4 with 4.2 I20111205-2330. |
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