Reference to method from javadoc @link doesn't count as usage
n my Java code I have public methods that are invoked using reflection and are therefore marked unused by IntelliJ. To help IntelliJ see they are in fact used, I make a @link reference to the particular methods in javadoc near the reflection part. The javadoc containing the @link references worked as documentation as well.
Before I updated IntelliJ this worked perfectly, but with the current version it doesn't. I can't find a setting in that turns this feature on. (I looked in Settings > Inspections > Java > Declaration redundancy > Unused declaration.) (I have also tried invalidating the caches and restarting.)
My version of IntelliJ:
IntelliJ IDEA 2018.1.4 (Ultimate Edition)
Build #IU-181.5087.20, built on May 16, 2018
Licensed to ****** / *****
Subscription is active until November 11, 2018
JRE: 1.8.0_152-release-1136-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Does somebody know if this behavior was changed or that I am missing a setting?
Thanks for the help.
Please sign in to leave a comment.
Works fine for me. Can you Ctrl-navigate to a method from the JavaDoc? Please try with all custom plugins disabled.
If problem remains, please report at https://youtrack.jetbrains.com/issues/IDEA with reproducible sample.
Hi Andrey,
thanks for your reply! I have tried what you proposed:
* Turn off custom plugins (which invalidates cache and forces a restart)
* Ctrl-click on @link, which jumps to the method.
* And when I do Alt-F7 (find usages) on the method, it shows the @link javadoc reference.
But still the method name is shown in grey instead of black.
I suppose I should report at IDEA.
Looks similar to https://youtrack.jetbrains.com/issue/IDEA-187170. If possible, please attach to the issue the sample project and your File | Export Settings... jar. Thanks.
I have done as you asked: https://youtrack.jetbrains.com/issue/IDEA-187170#comment=27-2884659
Thanks for looking into it.