zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eolive...@apache.org
Subject [zookeeper] branch master updated: ZOOKEEPER-3780: restore Version.getRevision() to be bacward compatible
Date Tue, 07 Apr 2020 13:41:03 GMT
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


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

commit d142e5a86993971a56bb2081020c085ed9ca68d7
Author: Norbert Kalmar <nkalmar@apache.org>
AuthorDate: Tue Apr 7 15:40:39 2020 +0200

    ZOOKEEPER-3780: restore Version.getRevision() to be bacward compatible
    
    Added a warning in https://cwiki.apache.org/confluence/display/ZOOKEEPER/Upgrade+FAQ
    
    Author: Norbert Kalmar <nkalmar@apache.org>
    
    Reviewers: Enrico Olivelli <eolivelli@apache.org>
    
    Closes #1304 from nkalmar/branch-3.6
    
    (cherry picked from commit 5062c39cb028115a9b79f9b28d6837065e70bf40)
    Signed-off-by: Enrico Olivelli <eolivelli@apache.org>
---
 .../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 4029c60..4fc0507 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/Version.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/Version.java
@@ -24,6 +24,18 @@ import org.apache.zookeeper.util.ServiceUtils;
 
 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 25bffd7..9bb699f 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");
             w.write("}\n");


Mime
View raw message