Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve At-clause should have a non-empty description? - Checkstyle - Java

I am using the google java style in the checkstyle plugin for eclipse luna. Seeing this error all over my java doc but cannot seem to find how to resolve it. It's minor but its bugging me.

my javadoc:

/**
   * This is a description of something
   * 
   * @throws Exception
   */

Error is on the @throws line, Error:

At-clause should have a non-empty description
like image 868
wondergoat77 Avatar asked Oct 09 '15 17:10

wondergoat77


2 Answers

Typically, you should write

 * @throws Exception when this exceptional condition happens

e.g.

 * @throws IllegalArgumentException when num is negative

...and generally explaining why that exception would occur.

like image 169
Louis Wasserman Avatar answered Nov 05 '22 14:11

Louis Wasserman


This is the generic message shown for every parameters in doc starting with '@'. So for every param you need to add some description.

For example:

/**
     * Searches for top cars
     * @param carSearchRequest represents CarSearchRequest body
     * @param userId represents userid
     * @return CarsResponse
     * @throws Exception when userid is null
     */
like image 2
KayV Avatar answered Nov 05 '22 12:11

KayV