From 5edb75e0a911d0b3ca8db2aae3a62390e6bff161 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Sun, 29 Jul 2012 15:22:15 +0200 Subject: [PATCH] use toLowerCase with locale --- .../java/sonia/scm/plugin/PluginVersion.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/scm-core/src/main/java/sonia/scm/plugin/PluginVersion.java b/scm-core/src/main/java/sonia/scm/plugin/PluginVersion.java index 1e1cbe19e6..7d0d102deb 100644 --- a/scm-core/src/main/java/sonia/scm/plugin/PluginVersion.java +++ b/scm-core/src/main/java/sonia/scm/plugin/PluginVersion.java @@ -35,12 +35,15 @@ package sonia.scm.plugin; //~--- non-JDK imports -------------------------------------------------------- -import java.util.Locale; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sonia.scm.util.AssertUtil; +//~--- JDK imports ------------------------------------------------------------ + +import java.util.Locale; + /** * * @author Sebastian Sdorra @@ -216,8 +219,8 @@ public class PluginVersion implements Comparable } if ((this.parsedVersion == null) - ? (other.parsedVersion != null) - : !this.parsedVersion.equals(other.parsedVersion)) + ? (other.parsedVersion != null) + : !this.parsedVersion.equals(other.parsedVersion)) { return false; } @@ -255,14 +258,14 @@ public class PluginVersion implements Comparable hash = 61 * hash + this.major; hash = 61 * hash + this.minor; hash = 61 * hash + ((this.parsedVersion != null) - ? this.parsedVersion.hashCode() - : 0); + ? this.parsedVersion.hashCode() + : 0); hash = 61 * hash + (this.snapshot - ? 1 - : 0); + ? 1 + : 0); hash = 61 * hash + ((this.type != null) - ? this.type.hashCode() - : 0); + ? this.type.hashCode() + : 0); hash = 61 * hash + this.typeVersion; return hash; @@ -477,7 +480,7 @@ public class PluginVersion implements Comparable { for (String name : versionType.getNames()) { - name = name.toLowerCase(); + name = name.toLowerCase(Locale.ENGLISH); int index = qualifier.indexOf(name);