diff options
author | 2020-06-19 13:37:34 +0800 | |
---|---|---|
committer | 2020-07-06 17:48:27 +0800 | |
commit | a1b98fecda5e9d9c832b73305fb47edc604dd06d (patch) | |
tree | 50797b3e7cd408307feff45f65b725e3eb7c232d | |
parent | fix bugs of MAVEN_PROVIDE (diff) | |
download | java-ebuilder-a1b98fecda5e9d9c832b73305fb47edc604dd06d.tar.gz java-ebuilder-a1b98fecda5e9d9c832b73305fb47edc604dd06d.tar.bz2 java-ebuilder-a1b98fecda5e9d9c832b73305fb47edc604dd06d.zip |
MavenVersion.class enhancement:
make MavenVersion.class able to compare incremental version
make it convert qualifier to lowercase to avoid the situation when
maintainer mixes uppercase and lowercase
Signed-off-by: zongyu <zzy2529420793@gmail.com>
-rw-r--r-- | src/main/java/org/gentoo/java/ebuilder/portage/MavenVersion.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/gentoo/java/ebuilder/portage/MavenVersion.java b/src/main/java/org/gentoo/java/ebuilder/portage/MavenVersion.java index 71da8a6..42cd9cd 100644 --- a/src/main/java/org/gentoo/java/ebuilder/portage/MavenVersion.java +++ b/src/main/java/org/gentoo/java/ebuilder/portage/MavenVersion.java @@ -70,7 +70,7 @@ public class MavenVersion implements Comparable<MavenVersion> { ? 0 : Integer.parseInt(matcher.group(2), 10); incrementalVersion = matcher.group(3) == null ? 0 : Integer.parseInt(matcher.group(3), 10); - qualifier = matcher.group(4) == null ? "" : matcher.group(4); + qualifier = matcher.group(4) == null ? "" : matcher.group(4).toLowerCase(); } @Override @@ -81,6 +81,8 @@ public class MavenVersion implements Comparable<MavenVersion> { return Integer.valueOf(majorVersion).compareTo(o.getMajorVersion()); } else if (minorVersion != o.getMinorVersion()) { return Integer.valueOf(minorVersion).compareTo(o.getMinorVersion()); + } else if (incrementalVersion != o.getIncrementalVersion()) { + return Integer.valueOf(incrementalVersion).compareTo(o.getIncrementalVersion()); } else { return qualifier.compareTo(o.getQualifier()); } |