From 62f436f552d81df53a4f4abdab25198e8edc258f Mon Sep 17 00:00:00 2001 From: "@aleksandr.zakshevskii" Date: Mon, 15 Jul 2019 20:55:52 +0200 Subject: [PATCH] prevent NumberFormatException for huge versions of tags --- .../groovy/net/nemerosa/versioning/support/TagSupport.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/net/nemerosa/versioning/support/TagSupport.groovy b/src/main/groovy/net/nemerosa/versioning/support/TagSupport.groovy index 8522418..ec0af64 100644 --- a/src/main/groovy/net/nemerosa/versioning/support/TagSupport.groovy +++ b/src/main/groovy/net/nemerosa/versioning/support/TagSupport.groovy @@ -4,14 +4,14 @@ import java.util.regex.Matcher class TagSupport { - static int tagOrder(String tagPattern, String tagName) { + static BigInteger tagOrder(String tagPattern, String tagName) { Matcher m = tagName =~ tagPattern if (m.find()) { int ngroups = m.groupCount() if (ngroups < 1) { throw new IllegalArgumentException("Tag pattern is expected to have at least one number grouping instruction: $tagPattern") } else { - return m.group(1) as int + return new BigInteger(m.group(1)) } } else { throw new IllegalStateException("Tag $tagName should have matched $tagPattern")