Version.major() and Version.security() will return 0 if those values are set to zero OR if they are unset. If a user tries to construct a String which contains trialing zeros, and then invokes Version.parse(), this will fail, even if the source of the zeros was a valid Version object. For example:
Version v = Version.parse("9");
Version ver = Version.parse(String.format("%d.%d.%d%n),
v.major(), v.minor(), v.security())); // IAE
If the current method signatures returning int are retained, constants NO_MINOR_VERSION and NO_MAJOR_VERSION (both = -1) could be returned instead of 0.
Alternatively, changing the methods' return value to Integer and returning null might be more palatable.
If we re-consider how trialing zeros are handled, there are a number of additional options, some combination of which would address this problem or at least reduce impact.