DATACMNS-496 - Version.parse(…) now drops non-numeric artifacts.

Version parsing failed when given version contained non-numeric parts (like 2.0.0-rc1). We now strip everything after the first non numeric part to create a logical version equivalent of the source String.

Original pull request: #81.
This commit is contained in:
Christoph Strobl
2014-04-29 15:41:49 +02:00
committed by Oliver Gierke
parent ec49499e50
commit 57271baf54
2 changed files with 9 additions and 1 deletions

View File

@@ -53,7 +53,7 @@ public class Version implements Comparable<Version> {
int[] intParts = new int[parts.length];
for (int i = 0; i < parts.length; i++) {
intParts[i] = Integer.parseInt(parts[i]);
intParts[i] = Integer.parseInt(parts[i].replaceAll("\\D.*", ""));
}
return new Version(intParts);