Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning: Dangling Javadoc comment

Since I updated my Android Studio (2.3.1) and build tools (2.3.1), I'm getting warning,

Warning: Dangling Javadoc comment

for comments like,

/** set name with format, {@Link FORMAT_NAME} **/
setNameText(getFormattedName(FORMAT_NAME));

As you can see, I use javadoc style comment for linking and others. I'm wondering if there are other comment alternatives that have linking feature.

Thanks.

like image 878
Dhunju_likes_to_Learn Avatar asked Apr 12 '17 16:04

Dhunju_likes_to_Learn


4 Answers

It looks like you are using a Javadoc comment when you call the method setNameText. Javadoc comments are to be inserted above a class declaration, a method declaration, or a field declaration.

If you simply want a comment when calling the method, use the one-line comment: // get formatted name based on {@link FORMAT_NAME}.

like image 152
gjigandi Avatar answered Nov 10 '22 17:11

gjigandi


You are using Javadoc format which starts with /** instead of a block comment format which starts with /* .

To alleviate that warning, always start your comments inside the methods with /* not /**.

like image 36
Dev_mjm Avatar answered Nov 10 '22 18:11

Dev_mjm


In case it helps someone else, make sure you didn't sneak your JavaDoc between the method/class definition and any annotations you had on that definition.

like image 18
Snekse Avatar answered Nov 10 '22 16:11

Snekse


Just replace "Dangling Javadoc Comment" with block comment.

like image 2
Cobain Avatar answered Nov 10 '22 18:11

Cobain