Reputation: 3985
When over a variable/parameter/method name, if we press alt+shift+r, we can rename all usages of that identifier.
But, how can I create such identifier reference on the method's javadoc that will be recognized by eclipse and be automatically updated as the code is?
I have tried,
for local method variables {@code varName}, <code>varName</code>
for enums ${link EnumName.constantName}
...
nothing changes at javadoc when renaming/refactoring.
PS.: I am not talking about @param
Upvotes: 0
Views: 525
Reputation: 1015
After you press Alt+Shift+R, click the small arrow on the right of the popup, then "Open Rename Dialog..." and select "Update textual occurences in comments and strings (forces preview)". Eclipse will search for any occurrences and change them after showing you a preview. This works for classes, enums and also instance and class variables.
For local variables, this option is not available. I suppose the reason is, that there is generally no point in documenting local variables in Javadoc comments. You can use find/replace (Ctrl+F) as a workaround.
Upvotes: 3