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.
From the main menu, select Tools | Generate JavaDoc. In the dialog that opens, select a scope — a set of files or directories for which you want to generate the reference, and set the output directory where the generated documentation will be placed.
Javadoc is a tool for generating API documentation in HTML format from doc comments in source code. It can be downloaded only as part of the Java 2 SDK. To see documentation generated by the Javadoc tool, go to J2SE 1.5. 0 API Documentation.
A doc comment is written in HTML and must precede a class, field, constructor or method declaration. It is made up of two parts -- a description followed by block tags. In this example, the block tags are @param , @return , and @see .
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 {
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With