Merge branch 'develop' into trialMerge
[jalview.git] / src / jalview / util / Comparison.java
index a8ad086..1326647 100644 (file)
@@ -416,18 +416,24 @@ public class Comparison
     return isNucleotide(oneDArray);
   }
 
-  public static boolean compareChars(char c1, char c2, boolean caseSensitive)
+  /**
+   * Compares two residues either case sensitively or case insensitively
+   * depending on the caseSensitive flag
+   * 
+   * @param c1
+   *          first char
+   * @param c2
+   *          second char to compare with
+   * @param caseSensitive
+   *          if true comparison will be case sensitive otherwise its not
+   * @return
+   */
+  public static boolean isSameResidue(char c1, char c2,
+          boolean caseSensitive)
   {
-    boolean sameCase = (Character.isUpperCase(c1) && Character
-            .isUpperCase(c2))
-            || (Character.isLowerCase(c1) && Character.isLowerCase(c2));
-    if (sameCase)
+    if (caseSensitive)
     {
-      return c1 == c2;
-    }
-    else if (caseSensitive)
-    {
-      return false;
+      return (c1 == c2);
     }
     else
     {