summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikaelpeltier <mikaelpeltier@google.com>2015-06-25 15:35:49 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-06-25 15:35:50 +0000
commit5fca09e5db3653c759fa529c14734b51c2f02ff9 (patch)
tree5d50e87b5b66af263bd7a8401eb4510c1c903f14
parentb6625e0cc388499ae22755ade03e90e05537e140 (diff)
parent572a6facb459a7ac02c4f3ba1d71fa02e09a5060 (diff)
downloadtoolchain_jack-5fca09e5db3653c759fa529c14734b51c2f02ff9.tar.gz
toolchain_jack-5fca09e5db3653c759fa529c14734b51c2f02ff9.tar.bz2
toolchain_jack-5fca09e5db3653c759fa529c14734b51c2f02ff9.zip
Merge "Add isComparable method into Version" into ub-jack-brest
-rw-r--r--sched/src/com/android/sched/util/Version.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/sched/src/com/android/sched/util/Version.java b/sched/src/com/android/sched/util/Version.java
index 3128edd6..0586680e 100644
--- a/sched/src/com/android/sched/util/Version.java
+++ b/sched/src/com/android/sched/util/Version.java
@@ -201,13 +201,14 @@ public class Version {
^ (codeBase != null ? codeBase.hashCode() : 0);
}
- int compareTo(@Nonnull Version other) throws UncomparableVersion {
- if (subReleaseKind == SubReleaseKind.ENGINEERING
+ public boolean isComparable() {
+ return !(subReleaseKind == SubReleaseKind.ENGINEERING
|| releaseCode <= 0
- || subReleaseCode <= 0
- || other.getSubReleaseKind() == SubReleaseKind.ENGINEERING
- || other.getReleaseCode() <= 0
- || other.getSubReleaseCode() <= 0) {
+ || subReleaseCode <= 0);
+ }
+
+ int compareTo(@Nonnull Version other) throws UncomparableVersion {
+ if (!isComparable() || !other.isComparable()) {
throw new UncomparableVersion(
getVerboseVersion() + " is not comparable with " + other.getVerboseVersion());
}