ONOS-4674 - update the version parsing to treat everything after the last separa…
…tor as a single value Change-Id: Ie4deac82c4e08eb7fccb12df7c2687a1adead889
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -77,7 +77,7 @@ public final class Version { | ... | @@ -77,7 +77,7 @@ public final class Version { |
77 | * @return version descriptor | 77 | * @return version descriptor |
78 | */ | 78 | */ |
79 | public static Version version(String string) { | 79 | public static Version version(String string) { |
80 | - String[] fields = string.split("[.-]"); | 80 | + String[] fields = string.split("[.-]", 4); |
81 | checkArgument(fields.length >= 2, TOO_SHORT); | 81 | checkArgument(fields.length >= 2, TOO_SHORT); |
82 | return new Version(parseInt(fields[0]), parseInt(fields[1]), | 82 | return new Version(parseInt(fields[0]), parseInt(fields[1]), |
83 | fields.length >= 3 ? fields[2] : null, | 83 | fields.length >= 3 ? fields[2] : null, | ... | ... |
-
Please register or login to post a comment