Skip to content

Commit

Permalink
There are no svn* versions for 3.3.1, so we no longer need to parse
Browse files Browse the repository at this point in the history
them. Removed svn version parsing code.
  • Loading branch information
uckelman committed Jun 22, 2020
1 parent 0231b97 commit 564144b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
22 changes: 0 additions & 22 deletions src/VASSAL/tools/version/VassalVersionTokenizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ protected enum State { VNUM, DELIM1, TAG, DELIM2, BUILD, EOS, END };
// alone need to be maintined here. (E.g., the 3.1.0 tags can be removed
// as soon as 3.1.1 is released.) We keep one tag for testing purposes.
protected static Map<String,Integer> tags = Map.of(
"beta1", 9367,
"beta2", 9373,
"beta3", 9384,
"beta4", 9453
);

Expand Down Expand Up @@ -125,25 +122,6 @@ public int next() throws VersionFormatException {
state = State.BUILD;
break;
}
else if (v.startsWith("svn")) {
// report the svn version
// TODO: remove this case when 3.3.1 is released
v = v.substring(3);
try {
n = Integer.parseInt(v);
}
catch (NumberFormatException e) {
throw new VersionFormatException(e);
}

if (n < 0) {
throw new VersionFormatException();
}

v = "";
state = State.EOS;
return n;
}
else {
final int hi = v.indexOf('-');
String k;
Expand Down
8 changes: 3 additions & 5 deletions test/VASSAL/tools/version/VassalVersionTokenizerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ public void testTokenizer() throws VersionFormatException {
final Object[][] versions = {
{ "1.2.3", 1, 2, 3 },
{ "1.2.3.4", 1, 2, 3, 4 },
{ "1.2.3-svn7890", 1, 2, 3, -2, 7890 },
{ "1.2.3-rc3", 1, 2, 3, -2, null },
{ "foobarbaz", null },
{ "1.2.foo", 1, 2, null },
{ "1.2-foo", 1, 2, -2, null },
{ "1.2-svn1234.8", 1, 2, -2, null },
{ "3.0b6", 3, 0, null },
{ "3.3.0-beta1", 3, 3, 0, -2, 9367 },
{ "3.3.0-beta3-80", 3, 3, 0, -2, 9384, 80 },
{ "3.3.0-beta3-80-gf8ef2523", 3, 3, 0, -2, 9384, 80 }
{ "3.3.0-beta4", 3, 3, 0, -2, 9453 },
{ "3.3.0-beta4-80", 3, 3, 0, -2, 9453, 80 },
{ "3.3.0-beta4-80-gf8ef2523", 3, 3, 0, -2, 9453, 80 }
};

for (Object[] v : versions) {
Expand Down

0 comments on commit 564144b

Please sign in to comment.