Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FISH-8482 Adjust Parsing of Version Number #6632

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* holder.
*/

// Portions Copyright [2016-2023] [Payara Foundation and/or affiliates]
// Portions Copyright 2016-2024 Payara Foundation and/or affiliates

package com.sun.appserv.server.util;

Expand Down Expand Up @@ -158,11 +158,11 @@ public static String getVersionNumber() {
// construct version number
String maj = getMajorVersion();
String min = getMinorVersion();
String upd = getUpdateVersion().replaceAll("\\D+", "");
String upd = getUpdateVersion();
String v;
try {
if (min != null && min.length() > 0 && Integer.parseInt(min) >= 0) {
if (upd != null && upd.length() > 0 && Integer.parseInt(upd) >= 0) {
if (upd != null && upd.length() > 0) {
v = maj + "." + min + "." + upd;
} else {
v = maj + "." + min;
Expand Down Expand Up @@ -205,14 +205,14 @@ public static String getMajorVersion() {
* Returns Minor version
*/
public static String getMinorVersion() {
return getProperty(MINOR_VERSION_KEY, "0").replace("-SNAPSHOT", "");
return getProperty(MINOR_VERSION_KEY, "0");
}

/**
* Returns Update version
*/
public static String getUpdateVersion() {
return getProperty(UPDATE_VERSION_KEY, "0");
return getProperty(UPDATE_VERSION_KEY, "0").replace("-SNAPSHOT", "");
}

/**
Expand Down