It might be weird. I have text as a method comment, and I can refer to it as follows:
/ ** {@link com.mypackage.YetAnotherClass # myMethod (String)}. * /
But I want to use this text as part of a line in code. It seems like I have a choice:
- Copy and paste the text from the comment into the code.
- Create a class with a static file and use it both in comments and in code in other classes.
The first parameter violates DRYand the second complicates the code by creating a new class. Is there any other way to use comment text in code?
source
share