Merge remote-tracking branch 'origin/releases/Release_2_10_2b1_Branch'
[jalview.git] / src / jalview / datamodel / Alignment.java
index 098222f..5733719 100755 (executable)
@@ -143,9 +143,8 @@ public class Alignment implements AlignmentI
    */
   public static AlignmentI createAlignment(CigarArray compactAlignment)
   {
-    throw new Error(
-            MessageManager
-                    .getString("error.alignment_cigararray_not_implemented"));
+    throw new Error(MessageManager
+            .getString("error.alignment_cigararray_not_implemented"));
     // this(compactAlignment.refCigars);
   }
 
@@ -188,7 +187,6 @@ public class Alignment implements AlignmentI
     return AlignmentUtils.getSequencesByName(this);
   }
 
-
   @Override
   public SequenceI getSequenceAt(int i)
   {
@@ -475,7 +473,9 @@ public class Alignment implements AlignmentI
       return;
     }
     // remove annotation very quickly
-    AlignmentAnnotation[] t, todelete = new AlignmentAnnotation[annotations.length], tokeep = new AlignmentAnnotation[annotations.length];
+    AlignmentAnnotation[] t,
+            todelete = new AlignmentAnnotation[annotations.length],
+            tokeep = new AlignmentAnnotation[annotations.length];
     int i, p, k;
     if (gp == null)
     {
@@ -608,7 +608,7 @@ public class Alignment implements AlignmentI
       sqname = sq.getName();
       if (sqname.equals(token) // exact match
               || (b && // allow imperfect matches - case varies
-              (sqname.equalsIgnoreCase(token))))
+                      (sqname.equalsIgnoreCase(token))))
       {
         return getSequenceAt(i);
       }
@@ -689,7 +689,6 @@ public class Alignment implements AlignmentI
     return -1;
   }
 
-
   @Override
   public int getHeight()
   {
@@ -1096,10 +1095,9 @@ public class Alignment implements AlignmentI
             }
             if (dbr.getMap().getTo().getDatasetSequence() != null)
             {
-              throw new Error(
-                      "Implementation error: Map.getTo() for dbref " + dbr
-                              + " from " + curDs.getName()
-                              + " is not a dataset sequence.");
+              throw new Error("Implementation error: Map.getTo() for dbref "
+                      + dbr + " from " + curDs.getName()
+                      + " is not a dataset sequence.");
             }
             // we recurse to add all forward references to dataset sequences via
             // DBRefs/etc
@@ -1236,8 +1234,8 @@ public class Alignment implements AlignmentI
       current = getSequenceAt(i);
       // This should really be a sequence method
       ends[i * 2] = current.findIndex(current.getStart());
-      ends[i * 2 + 1] = current.findIndex(current.getStart()
-              + current.getLength());
+      ends[i * 2 + 1] = current
+              .findIndex(current.getStart() + current.getLength());
       boolean hitres = false;
       for (int j = 0, rs = 0, ssiz = current.getLength(); j < ssiz; j++)
       {
@@ -1478,8 +1476,10 @@ public class Alignment implements AlignmentI
     boolean hashidden = toappend.getHiddenSequences() != null
             && toappend.getHiddenSequences().hiddenSequences != null;
     // get all sequences including any hidden ones
-    List<SequenceI> sqs = (hashidden) ? toappend.getHiddenSequences()
-            .getFullAlignment().getSequences() : toappend.getSequences();
+    List<SequenceI> sqs = (hashidden)
+            ? toappend.getHiddenSequences().getFullAlignment()
+                    .getSequences()
+            : toappend.getSequences();
     if (sqs != null)
     {
       // avoid self append deadlock by
@@ -1561,8 +1561,8 @@ public class Alignment implements AlignmentI
             if (ourval instanceof String)
             {
               // append strings
-              this.setProperty(k, ((String) ourval) + "; "
-                      + ((String) toapprop));
+              this.setProperty(k,
+                      ((String) ourval) + "; " + ((String) toapprop));
             }
             else
             {
@@ -1630,9 +1630,8 @@ public class Alignment implements AlignmentI
     {
       for (AlignmentAnnotation a : alignmentAnnotation)
       {
-        if (a.getCalcId() == calcId
-                || (a.getCalcId() != null && calcId != null && a
-                        .getCalcId().equals(calcId)))
+        if (a.getCalcId() == calcId || (a.getCalcId() != null
+                && calcId != null && a.getCalcId().equals(calcId)))
         {
           aa.add(a);
         }
@@ -1648,11 +1647,12 @@ public class Alignment implements AlignmentI
     ArrayList<AlignmentAnnotation> aa = new ArrayList<>();
     for (AlignmentAnnotation ann : getAlignmentAnnotation())
     {
-      if ((calcId == null || (ann.getCalcId() != null && ann.getCalcId()
-              .equals(calcId)))
-              && (seq == null || (ann.sequenceRef != null && ann.sequenceRef == seq))
-              && (label == null || (ann.label != null && ann.label
-                      .equals(label))))
+      if ((calcId == null || (ann.getCalcId() != null
+              && ann.getCalcId().equals(calcId)))
+              && (seq == null || (ann.sequenceRef != null
+                      && ann.sequenceRef == seq))
+              && (label == null
+                      || (ann.label != null && ann.label.equals(label))))
       {
         aa.add(ann);
       }