|
@@ -89,23 +89,23 @@ public class SystemVersion extends Version {
|
|
|
/**
|
|
|
* @see SystemVersion#name
|
|
|
*/
|
|
|
- String name = "name";
|
|
|
+ String name = "name";
|
|
|
/**
|
|
|
* @see SystemVersion#comment
|
|
|
*/
|
|
|
- String comment = "comment";
|
|
|
+ String comment = "comment";
|
|
|
/**
|
|
|
* @see SystemVersion#website
|
|
|
*/
|
|
|
- String website = "website";
|
|
|
+ String website = "website";
|
|
|
/**
|
|
|
* @see SystemVersion#majorVersion
|
|
|
*/
|
|
|
- String majorVersion = "majorVersion";
|
|
|
+ String majorVersion = "majorVersion";
|
|
|
/**
|
|
|
* @see SystemVersion#minorVersion
|
|
|
*/
|
|
|
- String minorVersion = "minorVersion";
|
|
|
+ String minorVersion = "minorVersion";
|
|
|
/**
|
|
|
* @see SystemVersion#revisionVersion
|
|
|
*/
|
|
@@ -113,7 +113,7 @@ public class SystemVersion extends Version {
|
|
|
/**
|
|
|
* @see SystemVersion#snapshot
|
|
|
*/
|
|
|
- String snapshot = "snapshot";
|
|
|
+ String snapshot = "snapshot";
|
|
|
|
|
|
/**
|
|
|
* @see SystemVersion#frameworkVersion
|
|
@@ -183,13 +183,13 @@ public class SystemVersion extends Version {
|
|
|
|
|
|
@Slf4j
|
|
|
class Version implements Comparable<Version> {
|
|
|
- protected String name;
|
|
|
- protected String comment;
|
|
|
- protected String website;
|
|
|
- protected int majorVersion = 1;
|
|
|
- protected int minorVersion = 0;
|
|
|
- protected int revisionVersion = 0;
|
|
|
- protected boolean snapshot = false;
|
|
|
+ protected String name;
|
|
|
+ protected String comment;
|
|
|
+ protected String website;
|
|
|
+ protected int majorVersion = 1;
|
|
|
+ protected int minorVersion = 0;
|
|
|
+ protected int revisionVersion = 0;
|
|
|
+ protected boolean snapshot = false;
|
|
|
|
|
|
public void setVersion(int major, int minor, int revision, boolean snapshot) {
|
|
|
this.majorVersion = major;
|
|
@@ -293,13 +293,7 @@ class Version implements Comparable<Version> {
|
|
|
return -1;
|
|
|
}
|
|
|
if (o.getMinorVersion() == this.getMinorVersion()) {
|
|
|
- if (o.getRevisionVersion() > this.getRevisionVersion()) {
|
|
|
- return -1;
|
|
|
- }
|
|
|
- if (o.getRevisionVersion() == this.getRevisionVersion()) {
|
|
|
- return 0;
|
|
|
- }
|
|
|
- return 1;
|
|
|
+ return Integer.compare(this.getRevisionVersion(), o.getRevisionVersion());
|
|
|
} else {
|
|
|
return 1;
|
|
|
}
|
|
@@ -309,18 +303,17 @@ class Version implements Comparable<Version> {
|
|
|
}
|
|
|
|
|
|
public String versionToString() {
|
|
|
- return new StringBuilder()
|
|
|
- .append(majorVersion).append(".")
|
|
|
- .append(minorVersion).append(".")
|
|
|
- .append(revisionVersion).append(snapshot ? "-SNAPSHOT" : "").toString();
|
|
|
+ return String.valueOf(majorVersion) + "." +
|
|
|
+ minorVersion + "." +
|
|
|
+ revisionVersion + (snapshot ? "-SNAPSHOT" : "");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public String toString() {
|
|
|
- return new StringBuilder(name).append(" version ")
|
|
|
- .append(majorVersion).append(".")
|
|
|
- .append(minorVersion).append(".")
|
|
|
- .append(revisionVersion).append(snapshot ? "-SNAPSHOT" : "").toString();
|
|
|
+ return name + " version " +
|
|
|
+ majorVersion + "." +
|
|
|
+ minorVersion + "." +
|
|
|
+ revisionVersion + (snapshot ? "-SNAPSHOT" : "");
|
|
|
}
|
|
|
|
|
|
}
|