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

nkalmar pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/branch-3.5 by this push:
     new fc7cc94  ZOOKEEPER-3780: restore Version.getRevision() to be bacward 
compatible
fc7cc94 is described below

commit fc7cc9412c6579defdba175b050a3a14709aec45
Author: Norbert Kalmar <nkal...@apache.org>
AuthorDate: Mon Apr 27 11:06:21 2020 +0200

    ZOOKEEPER-3780: restore Version.getRevision() to be bacward compatible
    
    for branch-3.5
    
    Author: Norbert Kalmar <nkal...@apache.org>
    
    Reviewers: Mate Szalay-Beko <sy...@apache.org>
    
    Closes #1309 from nkalmar/branch-3.5
---
 .../src/main/java/org/apache/zookeeper/Version.java          | 12 ++++++++++++
 .../main/java/org/apache/zookeeper/version/util/VerGen.java  |  1 +
 2 files changed, 13 insertions(+)

diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/Version.java 
b/zookeeper-server/src/main/java/org/apache/zookeeper/Version.java
index 0147c73..c2d38fc 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/Version.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/Version.java
@@ -22,6 +22,18 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 public class Version implements org.apache.zookeeper.version.Info {
 
+    /*
+     * Since the SVN to Git port this field doesn't return the revision anymore
+     * In version 3.5.6, 3.5.7 and 3.6.0 this function is removed by accident.
+     * From version 3.5.8+ and 3.6.1+ it is restored for backward 
compatibility, but will be removed later
+     * @deprecated deprecated in 3.5.5, use @see {@link #getRevisionHash()} 
instead
+     * @return the default value -1
+     */
+    @Deprecated
+    public static int getRevision() {
+        return REVISION;
+    }
+
     public static String getRevisionHash() {
         return REVISION_HASH;
     }
diff --git 
a/zookeeper-server/src/main/java/org/apache/zookeeper/version/util/VerGen.java 
b/zookeeper-server/src/main/java/org/apache/zookeeper/version/util/VerGen.java
index 2332796..832a00b 100644
--- 
a/zookeeper-server/src/main/java/org/apache/zookeeper/version/util/VerGen.java
+++ 
b/zookeeper-server/src/main/java/org/apache/zookeeper/version/util/VerGen.java
@@ -84,6 +84,7 @@ public class VerGen {
             if (rev.equals("-1")) {
                 System.out.println("Unknown REVISION number, using " + rev);
             }
+            w.write("    int REVISION=-1; //@deprecated, please use 
REVISION_HASH\n");
             w.write("    String REVISION_HASH=\"" + rev + "\";\n");
             w.write("    String BUILD_DATE=\"" + buildDate
                     + "\";\n");

Reply via email to