Skip to content

Commit 916cd62

Browse files
committed
Update VersionHelper
(merge 14.1.2-0 -> ce/14.1.2-0 118243) [git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v14.1.2.0/": change = 118246]
1 parent 398cdb6 commit 916cd62

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

prj/coherence-core/src/main/java/com/tangosol/internal/util/VersionHelper.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ public static int encodeVersion(int nMajor, int nMinor, int nMicro, int nPatchSe
8282
*/
8383
public static int getVersionPrefix(int nYear, int nMonth)
8484
{
85-
if (nYear > 23)
85+
if (nYear > 25)
86+
{
87+
return encodeVersion(15, 1, 1, 0, 0);
88+
}
89+
else if (nYear > 23)
8690
{
8791
return encodeVersion(15, 0, 0, 0, 0);
8892
}
@@ -402,6 +406,11 @@ public static void main(String[] args)
402406

403407
// ----- constants ------------------------------------------------------
404408

409+
/**
410+
* The encoded 15.1.1.0.0 version.
411+
*/
412+
public static final int VERSION_15_1_1_0_0 = encodeVersion(15, 1, 1, 0, 0);
413+
405414
/**
406415
* The encoded CE 25.03.0 version.
407416
*/

prj/test/unit/coherence-core-tests/src/test/java/com/tangosol/internal/util/VersionHelperTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,19 @@ public void shouldParseFusionAppsVersions()
178178
assertThat(nFA12PatchOne, is(greaterThan(nFA12PatchZero)));
179179
}
180180

181+
@Test
182+
public void shouldCompareTo_15_1_1()
183+
{
184+
int v1 = VersionHelper.encodeVersion(15, 1, 1, 0, 0);
185+
186+
int v2 = VersionHelper.encodeVersion(15, 1, 1, 0, 1);
187+
assertThat(v2, is(greaterThan(v1)));
188+
189+
int v3 = VersionHelper.encodeVersion(26, 3, 0);
190+
assertThat(v3, is(greaterThan(v1)));
191+
assertThat(v3, is(greaterThan(v2)));
192+
193+
int v4 = VersionHelper.encodeVersion(25, 3, 0);
194+
assertThat(v4, is(lessThan(v1)));
195+
}
181196
}

0 commit comments

Comments
 (0)