This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new ef23c67fd [#3084] feat(client-java): Add @Deprecated annotations and 
explanations across GravitinoClientBase   (#4338)
ef23c67fd is described below

commit ef23c67fd7d77dd29425ccb540ab4d115ffee761
Author: kartik <[email protected]>
AuthorDate: Fri Aug 2 12:30:49 2024 +0530

    [#3084] feat(client-java): Add @Deprecated annotations and explanations 
across GravitinoClientBase   (#4338)
    
    I added @Deprecated annotations to relevant methods in the
    GravitinoClientBase class to improve code clarity and guide developers
    towards using updated methods. - Deprecated `getVersion()` method in
    favor of `serverVersion()`. - Provided explanations within the
    annotations to clarify why the deprecation was applied and what should
    be used instead. This change ensures that outdated methods are clearly
    marked and helps maintain codebase consistency. Closes #3084
    
    As part of an effort to keep the Gravitino Java client codebase clean
    and up-to-date, deprecated annotations were added to certain methods in
    the GravitinoClientBase class. The `getVersion()` method was marked as
    deprecated since it duplicates the functionality provided by the
    `serverVersion()` method. An inline comment was provided to guide
    developers towards using the recommended method.
    
    This is my first contribution to the project, and I look forward to
    contributing further. Please review the changes and provide feedback if
    needed.
    
    ### What changes were proposed in this pull request?
    
    This pull request adds @Deprecated annotations to specific methods
    within the GravitinoClientBase class. The getVersion() method was
    deprecated in favor of serverVersion() to reduce redundancy and steer
    developers towards the preferred method. Each deprecated method includes
    a detailed comment explaining why the deprecation was applied and
    suggesting the appropriate alternative.
    
    ### Why are the changes needed?
    
    These changes are necessary to maintain a clean and up-to-date codebase.
    By marking certain methods as deprecated, we help developers avoid using
    outdated or redundant methods and encourage best practices within the
    Gravitino Java client. Specifically:
    
    The getVersion() method was deprecated as it duplicates the
    functionality of serverVersion().
    Developers are now guided to use the recommended methods via inline
    comments.
    
    Fix: #3084
    
    ### Does this PR introduce any  user-facing change?
    
    There are no direct user-facing changes. However, developers using the
    GravitinoClientBase class will now see deprecated warnings for certain
    methods, guiding them towards the recommended alternatives.
    
    ### How was this patch tested?
    The patch was tested by running the existing unit tests to ensure that
    the addition of @Deprecated annotations did not introduce any
    regressions or break existing functionality. No new tests were required,
    as this change is purely annotative and does not alter the underlying
    logic.
---
 .../src/main/java/org/apache/gravitino/client/GravitinoClientBase.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClientBase.java
 
b/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClientBase.java
index 26ab962d6..72a638f29 100644
--- 
a/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClientBase.java
+++ 
b/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClientBase.java
@@ -152,7 +152,8 @@ public abstract class GravitinoClientBase implements 
Closeable {
   /**
    * Retrieves the version of the Gravitino API.
    *
-   * @return A GravitinoVersion instance representing the version of the 
Gravitino API.
+   * @deprecated This method is deprecated because it is a duplicate of {@link 
#serverVersion()}.
+   *             Use {@link #serverVersion()} instead for clarity and 
consistency.
    */
   @Deprecated
   @InlineMe(replacement = "this.serverVersion()")

Reply via email to