From 564144b6b3e83b355c09a692e010a967f239a299 Mon Sep 17 00:00:00 2001 From: Joel Uckelman Date: Mon, 22 Jun 2020 18:44:09 +0100 Subject: [PATCH] There are no svn* versions for 3.3.1, so we no longer need to parse them. Removed svn version parsing code. --- .../tools/version/VassalVersionTokenizer.java | 22 ------------------- .../version/VassalVersionTokenizerTest.java | 8 +++---- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/VASSAL/tools/version/VassalVersionTokenizer.java b/src/VASSAL/tools/version/VassalVersionTokenizer.java index 6fa6def10f..71f603c4ab 100644 --- a/src/VASSAL/tools/version/VassalVersionTokenizer.java +++ b/src/VASSAL/tools/version/VassalVersionTokenizer.java @@ -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 tags = Map.of( - "beta1", 9367, - "beta2", 9373, - "beta3", 9384, "beta4", 9453 ); @@ -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; diff --git a/test/VASSAL/tools/version/VassalVersionTokenizerTest.java b/test/VASSAL/tools/version/VassalVersionTokenizerTest.java index 63e4ca38e7..a99430330c 100644 --- a/test/VASSAL/tools/version/VassalVersionTokenizerTest.java +++ b/test/VASSAL/tools/version/VassalVersionTokenizerTest.java @@ -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) {