This commit is contained in:
Stephane Nicoll 2020-06-05 10:20:58 +02:00
parent 76a61d832f
commit 15157c941f

View File

@ -87,11 +87,8 @@ public final class Version implements Serializable, Comparable<Version> {
if (this.format == format) {
return this;
}
if (format == Format.V1) {
Qualifier qualifier = formatQualifier(".", this::toV1Qualifier);
return new Version(this.major, this.minor, this.patch, qualifier);
}
Qualifier qualifier = formatQualifier("-", this::toV2Qualifier);
Qualifier qualifier = (format == Format.V1) ? formatQualifier(".", this::toV1Qualifier)
: formatQualifier("-", this::toV2Qualifier);
return new Version(this.major, this.minor, this.patch, qualifier);
}