Warning: Dangling Javadoc comment

Dhunju_likes_to_Learn picture Dhunju_likes_to_Learn · Apr 12, 2017 · Viewed 21.7k times · Source

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.

Answer

gjigandi picture gjigandi · Apr 22, 2017

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}.