JAL-1355
[jalview.git] / src / jalview / analysis / Rna.java
index 4c05ece..e4a0d76 100644 (file)
@@ -35,6 +35,7 @@ import java.util.Vector;
 
 import jalview.analysis.SecStrConsensus.SimpleBP;
 import jalview.datamodel.SequenceFeature;
+import jalview.util.MessageManager;
 
 public class Rna
 {
@@ -85,9 +86,7 @@ public class Rna
   {
     if (!isClosingParenthesis(closingParenthesis))
     {
-      throw new WUSSParseException(
-              "Querying matching opening parenthesis for non-closing parenthesis character "
-                      + closingParenthesis, -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);
@@ -132,16 +131,14 @@ public class Rna
 
         if (!stacks.containsKey(opening))
         {
-          throw new WUSSParseException(
-                  "Mismatched (unseen) closing character " + base, 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("Mismatched closing character "
-                  + base, i);
+          throw new WUSSParseException(MessageManager.formatMessage("exception.mismatched_closing_char", new String[]{new StringBuffer(base).toString()}), i);
         }
         int temp = stack.pop();
 
@@ -154,8 +151,7 @@ public class Rna
       Stack<Integer> stack = stacks.get(opening);
       if (!stack.empty())
       {
-        throw new WUSSParseException("Mismatched opening character "
-                + opening + " at " + stack.pop(), i);
+        throw new WUSSParseException(MessageManager.formatMessage("exception.mismatched_opening_char", new String[]{new StringBuffer(opening).toString(),Integer.valueOf(stack.pop()).toString()}), i);
       }
     }
     return pairs;