Warning: Dangling Javadoc comment

后端 未结 6 2258
难免孤独
难免孤独 2021-02-12 12:27

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

Warning: Dangling Javadoc comment

for comme

相关标签:
6条回答
  • 2021-02-12 12:56

    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 /**.

    0 讨论(0)
  • 2021-02-12 13:01

    Just replace "Dangling Javadoc Comment" with block comment.

    0 讨论(0)
  • 2021-02-12 13:03

    To me it seems like the right place for this comment is alongside method getFormattedName() because your comment explains the functionality of that method not the reason you're calling it.

    0 讨论(0)
  • 2021-02-12 13:08

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

    0 讨论(0)
  • 2021-02-12 13:12

    You may just turn it off in page "File-Settings-Editor-Inspections-Java-Javadoc issues-Dangling Javadoc comment".

    0 讨论(0)
  • 2021-02-12 13:13

    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.

    0 讨论(0)
提交回复
热议问题