Skip to content

Commit

Permalink
ZOOKEEPER-3780: restore Version.getRevision() to be bacward compatible
Browse files Browse the repository at this point in the history
Added a warning in https://cwiki.apache.org/confluence/display/ZOOKEEPER/Upgrade+FAQ

Author: Norbert Kalmar <[email protected]>

Reviewers: Enrico Olivelli <[email protected]>

Closes apache#1304 from nkalmar/branch-3.6
  • Loading branch information
nkalmar authored and eolivelli committed Apr 7, 2020
1 parent 68466c8 commit 5062c39
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions zookeeper-server/src/main/java/org/apache/zookeeper/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@

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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public static void generateFile(File outputDir, Version version, String rev, Str
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");
Expand Down

0 comments on commit 5062c39

Please sign in to comment.