I did not check the specs, but in my application I must process partial version strings, like "1.2".
The current parser accepts only "1.2.0".
I patched the VersionParser.parseVersionCore() to:
private NormalVersion parseVersionCore() {
int major = Integer.parseInt(numericIdentifier());
consumeNextCharacter(DOT);
int minor = Integer.parseInt(numericIdentifier());
int patch;
try {
consumeNextCharacter(DOT);
patch = Integer.parseInt(numericIdentifier());
} catch (UnexpectedCharacterException e) {
patch = 0;
}
return new NormalVersion(major, minor, patch);
}
but perhaps there are better solution.
I did not check the specs, but in my application I must process partial version strings, like "1.2".
The current parser accepts only "1.2.0".
I patched the VersionParser.parseVersionCore() to:
but perhaps there are better solution.