#387 Java 1.5 paramerized types broken

release_4.0
closed
None
5
2012-10-10
2005-11-29
Jon Schewe
No

If I have a class declaration like so:
/
* Creates queueObjects as needed.

/
abstract /package/ class
QueueObjectFactory {
...
}

and run checkstyle 4.0 on it, I get the following warning:
/net/users/jschewe/projects/argus/working-dir/java/src/scyllarus/dbutils/QueueObjectFactory.java:28:
Type Javadoc comment is missing an @param
tag.

If I change it to this:
/
* Creates queueObjects as needed.

* @param QueueObject_TYPE the type of queue object
that this factory will create
/
abstract /package/ class
QueueObjectFactory {
...
}
I get the following warning:
/net/users/jschewe/projects/argus/working-dir/java/src/scyllarus/dbutils/QueueObjectFactory.java:27:4:
Unused Javadoc tag.

Seems to me that there's no right answer here,
according to checkstyle.

Discussion

<< < 1 2 (Page 2 of 2)
  • Logged In: YES
    user_id=1022106

    I created the a file as below and the output is correct
    using sun_checks.xml. Removing the @param causes Checkstyle
    to complain, replacing it causes Checkstyle to be silent on
    the matter as it should be. Can you provide a standalone
    java file that you can submit to us that reproduces this
    problem?

    The bug I mentioned in my last response is actually in
    unconnected code (JavadocStyleCheck) so my suggestion
    probably won't work for you.

    /
    Blah blah.

    */
    public class QueueObjectFactory
    {
    }

    /
    Blah blah.

    */
    public class QueueObject
    {
    }

    /
    Creates queueObjects as needed.
    @param the type of queue object
    that this factory will create
    /
    abstract /
    package*/ class
    QueueObjectFactory {

    }

     
  • Jon Schewe
    Jon Schewe
    2005-12-01

    Logged In: YES
    user_id=209980

    So it's working. Turns out that there's another file in the
    same codebase that it was complaining about. Notice that my
    error messages were about SmartQueue.java, but my examples
    were all QueueObjectFactory? Sorry guys for the run around.
    At least I now know the right way to document these.
    Thanks for that.

    The following works:
    /
    * Creates queueObjects as needed.

    * @param the type of queue object that
    this factory will create
    /
    abstract /package/ class
    QueueObjectFactory {
    ...
    }

     
  • Logged In: YES
    user_id=1022106

    Yes, I did notice the naming difference but since the class
    was package visible it could easily have lived in
    SmartQueue.java

    I'm glad it's working for you and it's helped me spot a bug...

     
<< < 1 2 (Page 2 of 2)