Why does IntelliJ IDEA give a warning that this file javadoc is dangling?
Just in case, if you are interested in removing this dangling JavaDoc comment inspection, you can do so by disabling that from:
- Open preferences
- Navigate to Editor --> Inspections
- Under the menu list on right, select Java --> JavaDoc
- Uncheck "Dangling Javadoc comment"
You will also see this if you placed the Javadoc comment after any annotations.
For example:
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@SuppressWarnings({"unused", "WeakerAccess"})
/** --> Dangling Javadoc warning.
* This class does great and wonderful things.
*/
public class ClassThatDoesStuff {
}
Instead, the Javadoc must precede everything to receive the "No errors found in this file" seal of approval:
/**
* This class does great and wonderful things.
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@SuppressWarnings({"unused", "WeakerAccess"})
public class ClassThatDoesStuff {
}