#544 unused import if class referenced by javadoc

release_5.0
closed
nobody
Tests (17)
5
2012-10-10
2009-03-23
danrabe
No

Full example is attached.

File One.java contains the import for com.Two, and references that imported class in a JavaDoc comment:

import com.sub.Two;

/*
* Blah blah blah.
* @see Two
/

Checkstyle reports an unused import:

It's true, the import isn't required for compilation; however, removal of the import will cause JavaDoc errors:
C:\public\bugs\checkstyle\javadoc_reference\src\com\One.java:9: warning - Tag @see: reference not found: Two

I think the import should not be considered "unused" in this case.

Discussion

  • danrabe
    danrabe
    2009-03-23

    Example that demonstrates the problem.

     
    Attachments
  • Oliver Burn
    Oliver Burn
    2009-04-15

    duplicate of #652303