Format StringBuilder usage for readability
This commit is contained in:
parent
3ef6b4e105
commit
00e87f31da
|
@ -43,19 +43,16 @@ public class Version implements Comparable<Version> {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("^")
|
||||||
sb.append("^");
|
.append(NormalVersion.FORMAT)
|
||||||
sb.append(NormalVersion.FORMAT);
|
.append("(?:")
|
||||||
sb.append("(?:");
|
.append(PRE_RELEASE_PREFIX)
|
||||||
sb.append(PRE_RELEASE_PREFIX);
|
.append(AlphaNumericVersion.FORMAT)
|
||||||
sb.append(AlphaNumericVersion.FORMAT);
|
.append(")?").append("(?:")
|
||||||
sb.append(")?");
|
.append("\\").append(BUILD_PREFIX)
|
||||||
sb.append("(?:");
|
.append(AlphaNumericVersion.FORMAT)
|
||||||
sb.append("\\");
|
.append(")?")
|
||||||
sb.append(BUILD_PREFIX);
|
.append("$");
|
||||||
sb.append(AlphaNumericVersion.FORMAT);
|
|
||||||
sb.append(")?");
|
|
||||||
sb.append("$");
|
|
||||||
|
|
||||||
SEMVER_PATTERN = Pattern.compile(sb.toString());
|
SEMVER_PATTERN = Pattern.compile(sb.toString());
|
||||||
}
|
}
|
||||||
|
@ -171,12 +168,10 @@ public class Version implements Comparable<Version> {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder(getNormalVersion());
|
StringBuilder sb = new StringBuilder(getNormalVersion());
|
||||||
if (preRelease != null) {
|
if (preRelease != null) {
|
||||||
sb.append(PRE_RELEASE_PREFIX);
|
sb.append(PRE_RELEASE_PREFIX).append(getPreReleaseVersion());
|
||||||
sb.append(getPreReleaseVersion());
|
|
||||||
}
|
}
|
||||||
if (build != null) {
|
if (build != null) {
|
||||||
sb.append(BUILD_PREFIX);
|
sb.append(BUILD_PREFIX).append(getBuildVersion());
|
||||||
sb.append(getBuildVersion());
|
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user