For functions that don't change the state of an instance, the javadoc comment for the method is often the same or very similar as the one for the @return-tag in the Java-API.
boolean Collection.isEmpty()
- Returns true if this collection contains no elements.
- Returns: true if this collection contains no elements
Now I am writing javadoc for many simple methods like getExpression() where I have the same problem. Should I do it like in the API or leave it out?
question from:
https://stackoverflow.com/questions/10088311/javadoc-return-tag-comment-duplication-necessary 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…