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

CASSANDRA-18912 Update code style documentation for deprecation rules #245

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions site-content/source/modules/ROOT/pages/development/code_style.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,21 @@ https://gist.github.com/jdsumsion/9ab750a05c2a567c6afc[gist for IntelliJ
13] (this is a work in progress, still working on javadoc, ternary
style, line continuations, etc)
* Eclipse: (https://github.com/tjake/cassandra-style-eclipse)

== JavaDoc

=== Deprecation

To deprecate the old API, we use one of the built-in annotations of the Java language, the `@Deprecated` annotation with a `since` annotation element that points to the version since the API was deprecated. We always use it in conjunction with the `@deprecated` Javadoc tag, which describes the reason for the deprecation and an alternative, if applicable. A JIRA ticket is also worth mentioning in the deprecation message. All of these rules are enforced by the checkstyle.

Consider the following examples:

[source,java]
----
/** @deprecated Migrate to {@link DatabaseDescriptor#isClientInitialized()}. See CASSANDRA-1255 */
@Deprecated(since = "3.10")
public static boolean isClientMode()
{
return isClientMode;
}
----