JAL-1645 source formatting and organise imports
[jalview.git] / src / jalview / analysis / Rna.java
index 227bf09..e752126 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -42,15 +42,13 @@ public class Rna
 
   static Hashtable<Integer, Integer> pairHash = new Hashtable();
 
-  private static final Character[] openingPars =
-  { '(', '[', '{', '<', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
-      'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-      'Y', 'Z' };
+  private static final Character[] openingPars = { '(', '[', '{', '<', 'A',
+      'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
+      'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
 
-  private static final Character[] closingPars =
-  { ')', ']', '}', '>', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
-      'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
-      'y', 'z' };
+  private static final Character[] closingPars = { ')', ']', '}', '>', 'a',
+      'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
+      'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
 
   private static HashSet<Character> openingParsSet = new HashSet<Character>(
           Arrays.asList(openingPars));
@@ -86,7 +84,11 @@ public class Rna
   {
     if (!isClosingParenthesis(closingParenthesis))
     {
-      throw new WUSSParseException(MessageManager.formatMessage("exception.querying_matching_opening_parenthesis_for_non_closing_parenthesis", new String[]{new StringBuffer(closingParenthesis).toString()}), -1);
+      throw new WUSSParseException(
+              MessageManager.formatMessage(
+                      "exception.querying_matching_opening_parenthesis_for_non_closing_parenthesis",
+                      new String[] { new StringBuffer(closingParenthesis)
+                              .toString() }), -1);
     }
 
     return closingToOpening.get(closingParenthesis);
@@ -130,14 +132,18 @@ public class Rna
 
         if (!stacks.containsKey(opening))
         {
-          throw new WUSSParseException(MessageManager.formatMessage("exception.mismatched_unseen_closing_char", new String[]{new StringBuffer(base).toString()}), i);
+          throw new WUSSParseException(MessageManager.formatMessage(
+                  "exception.mismatched_unseen_closing_char",
+                  new String[] { new StringBuffer(base).toString() }), i);
         }
 
         Stack<Integer> stack = stacks.get(opening);
         if (stack.isEmpty())
         {
           // error whilst parsing i'th position. pass back
-          throw new WUSSParseException(MessageManager.formatMessage("exception.mismatched_closing_char", new String[]{new StringBuffer(base).toString()}), i);
+          throw new WUSSParseException(MessageManager.formatMessage(
+                  "exception.mismatched_closing_char",
+                  new String[] { new StringBuffer(base).toString() }), i);
         }
         int temp = stack.pop();
 
@@ -150,7 +156,10 @@ public class Rna
       Stack<Integer> stack = stacks.get(opening);
       if (!stack.empty())
       {
-        throw new WUSSParseException(MessageManager.formatMessage("exception.mismatched_opening_char", new String[]{new StringBuffer(opening).toString(),Integer.valueOf(stack.pop()).toString()}), i);
+        throw new WUSSParseException(MessageManager.formatMessage(
+                "exception.mismatched_opening_char",
+                new String[] { new StringBuffer(opening).toString(),
+                    Integer.valueOf(stack.pop()).toString() }), i);
       }
     }
     return pairs;