False+ : UnusedImport with Javadoc @throws
A source code analyzer
Brought to you by:
adangel,
juansotuyo
Javadoc generator uses import to fully qualified
classes mentionned in @link, for instance
@deprecated use {@link
ServiceProfileAdmin#setServiceStructure(ServiceProfileDescriptor,
ServiceStructureDescriptor)} instead.
PMD detect those imports as unused. (Eclipse behaves
correctly on this)
Logged In: YES
user_id=5159
Hi Florent -
Hmmm...... very interesting. Since PMD discards comments,
it doesn't pick this up. Hm. I hesitate to call this a
bug... but it would be nice if it picked up this "usage", so
I suppose it is....
Yours,
Tom
The similar issue was fixed in checkstyle in 2011 (https://sourceforge.net/tracker/?func=detail&atid=397078&aid=652303&group_id=29721).
hi
I'm interested in this "bug" due to hitting it in our project today. We were using pmd 4.6, but after downloading 5.0.2 I noticed it was still a problem. Can I help to fix it?
Hi,
can you provide me a sample file which triggers this false positive?
PMD should already properly handle @see, @link and @value tags in javadocs.
Thanks,
Andreas
I have a testcase I can give you to reproduce this bug.
Apologies for the delay in getting back to you, I was traveling. Little maven project. It throws up an unused import in SampleApp
mvn pmd:pmd
If you want I can open a new bug.
Last edit: thomaslennon 2013-04-08
Thanks for the test case.
I see now the problem, when it occurs: When declaring a RuntimeException via the @throws tag only in javadoc. As it is a runtime exception, the method itself might not declare this exception explicitly.