Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javadoc style guide: deprecations #42

Open
javier-godoy opened this issue Sep 18, 2024 · 2 comments
Open

Javadoc style guide: deprecations #42

javier-godoy opened this issue Sep 18, 2024 · 2 comments
Labels
agreed An agreement on the resolution has been reached

Comments

@javier-godoy
Copy link
Member

There is a @Deprecated annotation, and there is also a @deprecated javadoc tag (that predates the annotation).

There should be a guideline on which one to use.

  /** Sets the foo.
   * @param foo the foo to be set.
   * @deprecated Use {@code setFooBar} instead.*/
  @Deprecated(forRemoval = true)
  void setFoo(Object foo) {
    // ...
  }
@javier-godoy javier-godoy added the discuss The issue is scheduled for internal discussion label Sep 18, 2024
@javier-godoy
Copy link
Member Author

IMHO both must be required.

  • The annotation provides an idiomatic way of indicating deprecations. It has runtime retention and optional since/forRemoval attributes.
  • The javadoc tag allows an optional message providing additional information on the deprecation (e.g. whether the method was replaced, or whether a feature does not work as intended).

@paodb
Copy link
Member

paodb commented Sep 18, 2024

I agree that both should be present. Here's some additional information to the reasons Javier commented before.

@javier-godoy javier-godoy added agreed An agreement on the resolution has been reached and removed discuss The issue is scheduled for internal discussion labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agreed An agreement on the resolution has been reached
Projects
Status: In Progress
Development

No branches or pull requests

2 participants