Skip to content

Commit

Permalink
DCA11Y-1145: Comment reason for lowercasing the version
Browse files Browse the repository at this point in the history
  • Loading branch information
atl-mk committed Sep 20, 2024
1 parent a71d7f8 commit 13eb4d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import com.google.common.annotations.VisibleForTesting;

import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Stream;

import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toSet;

public class NodeVersionParser {

Expand All @@ -18,8 +18,7 @@ public class NodeVersionParser {
static final Pattern VALID_VERSION_PATTERN = Pattern.compile("^v?\\d*\\.\\d*\\.\\d*$");

static {
UNUSUAL_VALID_VERSIONS = new HashSet<>();
UNUSUAL_VALID_VERSIONS.addAll(asList(
UNUSUAL_VALID_VERSIONS = Stream.of(
"latest",
"latest-argon",
"latest-boron",
Expand Down Expand Up @@ -169,7 +168,7 @@ public class NodeVersionParser {
"node-v0.6.7",
"node-v0.6.8",
"node-v0.6.9"
));
).collect(toSet());
}

public static boolean validateVersion(String version) {
Expand All @@ -182,7 +181,7 @@ public static boolean validateVersion(String version) {
}

public static String fixupMinorVersionErrors(String version) {
version = version.toLowerCase();
version = version.toLowerCase(); // all the versions seem to be lower case

if (UNUSUAL_VALID_VERSIONS.contains(version)) {
return version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.slf4j.Logger;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
Expand Down

0 comments on commit 13eb4d1

Please sign in to comment.