#5261 JavaDoc @link error ?

In #5261 several JavaDoc @link entries are flagged as errors (Cannot resolve symbol) when the link is valid and Ctrl-B will correctly navigate to the declaration. For example:

  • Depending on the Config key, either set the status to {@link AttributeContainer.CONTAINER_STATUS_REFERENCE_VALIDATION_READY_ID}

  • or {@link AttributeContainer.CONTAINER_STATUS_CHECKING_WIP_ID}.


In these two lines (the first has wrapped in this post), the second link entry is highlighted red and flagged with a 'Cannot resolve symbol' error despite being valid and navigable.

Also, the horizontal scrollbar incorrectly sizes itself so that it will not scroll far enough to the right to make the last 3 characters visible. This appears to be a side-effect of having the first comment link extending 22 characters beyond the right margin (120 chars).

6 comments
Comment actions Permalink

Having just installed #5289, I can confirm that this problem is still present...

0
Comment actions Permalink

I have noticed this also in the v6 Beta build #5581.

0
Comment actions Permalink

Sorry - more details:

The block

Added column constants {@link COL_CUSTOMER_NAME} and {@link COL_CUSTOMER_NUMBER}.

Shows an error on the second link. Both values are present in the class:

// Comments removed for brevity.
public static final String COL_CUSTOMER_NAME = "CUSTOMER_NAME";

// Comments removed for brevity.
public static final String COL_CUSTOMER_NUMBER = "CUSTOMER_NUMBER";

Interestingly, both links initially look correct when the file is first viewed then the second link is marked as invalid. As mentioned by the previous poster, the link functions normally.

0
Comment actions Permalink

Correct syntax for fields and methods is
{@link #COL_CUSTOMER_NAME}
same for references to other classes
{@link OtherClass#COL_CUSTOMER_NAME}

Kevan Dunsmore schrieb:

Sorry - more details:

The block

Added column constants {@link COL_CUSTOMER_NAME} and {@link COL_CUSTOMER_NUMBER}.

Shows an error on the second link. Both values are present in the class:

// Comments removed for brevity.
public static final String COL_CUSTOMER_NAME = "CUSTOMER_NAME";

// Comments removed for brevity.
public static final String COL_CUSTOMER_NUMBER = "CUSTOMER_NUMBER";

Interestingly, both links initially look correct when the file is first viewed then the second link is marked as invalid. As mentioned by the previous poster, the link functions normally.

1
Comment actions Permalink

OK but the syntax

{@link OtherClass.COL_CUSTOMER_NAME}

works in V5 to reference static members of other classes. Is that not correct? A link of the above form (and the form you suggest in your post) is rendered in V5 in difference colors. The link of the form {@link OtherClass#COL_CUSTOMER_NAME} is rendered in the same color in V6, making it stand out less in the code.

0
Comment actions Permalink

>> Is that not correct?

No, it's not correct - see the javadoc manual.

{@link OtherClass#COL_CUSTOMER_NAME}

is the correct Javadoc syntax, regardless of what Idea does with it.

Idea should mark

{@link OtherClass.COL_CUSTOMER_NAME}

as an error


(see http://jetbrains.net/jira/browse/IDEADEV-2670)

0

Please sign in to leave a comment.