You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/09/13 20:23:11 UTC

[GitHub] [zookeeper] surajj-naik commented on a change in pull request #1456: ZOOKEEPER-3931: "zkServer.sh version" returns a trailing dash

surajj-naik commented on a change in pull request #1456:
URL: https://github.com/apache/zookeeper/pull/1456#discussion_r487573123



##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/version/util/VerGen.java
##########
@@ -119,7 +119,7 @@ public static void generateFile(File outputDir, Version version, String rev, Str
             w.write("public class " + VERSION_CLASS_NAME + " implements " + PACKAGE_NAME + ".Info {\n");
             w.write("    public static void main(String[] args) {\n");
             w.write("        final String VER_STRING = MAJOR + \".\" + MINOR + \".\" + MICRO +");
-            w.write("            (QUALIFIER == null ? \"\" : \"-\" + QUALIFIER)  + \" \" +");
+            w.write("            (QUALIFIER.isEmpty() ? \"\" : \"-\" + QUALIFIER)  + \" \" +");

Review comment:
       In line 83, it is set to empty string, if it is null - ` w.write("    String QUALIFIER=" + (version.qualifier == null ? "\"\"" : "\"" + version.qualifier + "\"") + ";\n");` which the VersionInfoMain implements.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org