Skip to content

Commit

Permalink
improve legibility of removed v1 constant
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize committed Nov 2, 2022
1 parent 6d10f49 commit 06177bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public void testEnsureVersionCompatibility() throws IOException {
ise = InboundDecoder.ensureVersionCompatibility(Version.V_2_0_0, version, true);
assertNull(ise);

ise = InboundDecoder.ensureVersionCompatibility(Version.fromId(1000099), version, false);
ise = InboundDecoder.ensureVersionCompatibility(VersionUtils.V_1_0_0, version, false);
assertEquals(
"Received message from unsupported version: [1.0.0] minimal compatible version is: ["
+ version.minimumCompatibilityVersion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@

/** Utilities for selecting versions in tests */
public class VersionUtils {
// version 1.0 is removed; this is used purely to retain consistent logic for migrations
@Deprecated
public static Version V_1_0_0 = Version.fromId(1000099 ^ Version.MASK);

/**
* Sort versions that have backwards compatibility guarantees from
Expand Down Expand Up @@ -104,7 +107,7 @@ static Tuple<List<Version>, List<Version>> resolveReleasedVersions(Version curre

// remove last minor unless it's the first OpenSearch version.
// all Legacy ES versions are released, so we don't exclude any.
if (current.equals(Version.fromId(1000099 ^ Version.MASK)) == false) {
if (current.equals(V_1_0_0) == false) {
List<Version> lastMinorLine = stableVersions.get(stableVersions.size() - 1);
if (lastMinorLine.get(lastMinorLine.size() - 1) instanceof LegacyESVersion == false) {
// if the last minor line is Legacy there are no more staged releases; do nothing
Expand Down

0 comments on commit 06177bd

Please sign in to comment.