Java – Why does IntelliJ IDEA give a warning that this file javadoc is dangling

intellij-ideajavajavadoc

I'm using IntelliJ IDEA and I tried to add a Javadoc comment at the top of the file like this:

/**
 * @file ProcessJson.java
 * @author Tim Sloane
 * @date 2017-05-09
 */

But IntelliJ gives me the warning "Dangling Javadoc comment." What makes this comment dangling? I thought because it's tagged with @file, it should be at the start of the file.

Best Answer

Just in case, if you are interested in removing this dangling JavaDoc comment inspection, you can do so by disabling that from:

  1. Open preferences
  2. Navigate to Editor --> Inspections
  3. Under the menu list on right, select Java --> JavaDoc
  4. Uncheck "Dangling Javadoc comment"

Remove Dangling Javadoc comment inspection