X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FRna.java;h=05573d7dabade0290c69dff49c241750e42bedf8;hb=ab43013b7e357b84b4abade0dba949668dfb2a0e;hp=4c05ece72126c1acfcc91b6ca477858d16a77e1e;hpb=7ab5d6b0ba5fec1ea4a4239e79c476d841622485;p=jalview.git diff --git a/src/jalview/analysis/Rna.java b/src/jalview/analysis/Rna.java index 4c05ece..05573d7 100644 --- a/src/jalview/analysis/Rna.java +++ b/src/jalview/analysis/Rna.java @@ -1,5 +1,5 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1) * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. @@ -26,6 +26,10 @@ package jalview.analysis; +import jalview.analysis.SecStrConsensus.SimpleBP; +import jalview.datamodel.SequenceFeature; +import jalview.util.MessageManager; + import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; @@ -33,9 +37,6 @@ import java.util.Hashtable; import java.util.Stack; import java.util.Vector; -import jalview.analysis.SecStrConsensus.SimpleBP; -import jalview.datamodel.SequenceFeature; - public class Rna { @@ -64,7 +65,7 @@ public class Rna { for (int i = 0; i < openingPars.length; i++) { - System.out.println(closingPars[i] + "->" + openingPars[i]); + // System.out.println(closingPars[i] + "->" + openingPars[i]); put(closingPars[i], openingPars[i]); } } @@ -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); @@ -108,7 +107,6 @@ public class Rna public static Vector GetSimpleBPs(CharSequence line) throws WUSSParseException { - System.out.println(line); Hashtable> stacks = new Hashtable>(); Vector pairs = new Vector(); int i = 0; @@ -132,16 +130,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 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 +150,7 @@ public class Rna Stack 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;