X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FRna.java;h=e5cda93b985f33520b6b5450ddeb624bb900bb24;hb=refs%2Fheads%2Ffeature%2FJAL-3187linkedFeatures;hp=34233f0c3000c8e3b31e7f88b5d059df434e5256;hpb=516567645c306018e92e4556a8c120b3b2cdbc60;p=jalview.git diff --git a/src/jalview/analysis/Rna.java b/src/jalview/analysis/Rna.java index 34233f0..e5cda93 100644 --- a/src/jalview/analysis/Rna.java +++ b/src/jalview/analysis/Rna.java @@ -49,7 +49,8 @@ public class Rna */ public static boolean isOpeningParenthesis(char c) { - return ('A' <= c && c <= 'Z' || c == '(' || c == '[' || c == '{' || c == '<'); + return ('A' <= c && c <= 'Z' || c == '(' || c == '[' || c == '{' + || c == '<'); } /** @@ -74,7 +75,8 @@ public class Rna */ public static boolean isClosingParenthesis(char c) { - return ('a' <= c && c <= 'z' || c == ')' || c == ']' || c == '}' || c == '>'); + return ('a' <= c && c <= 'z' || c == ')' || c == ']' || c == '}' + || c == '>'); } /** @@ -160,8 +162,8 @@ public class Rna if (!stacks.containsKey(opening)) { throw new WUSSParseException(MessageManager.formatMessage( - "exception.mismatched_unseen_closing_char", - new String[] { String.valueOf(base) }), i); + "exception.mismatched_unseen_closing_char", new String[] + { String.valueOf(base) }), i); } Stack stack = stacks.get(opening); @@ -169,8 +171,8 @@ public class Rna { // error whilst parsing i'th position. pass back throw new WUSSParseException(MessageManager.formatMessage( - "exception.mismatched_closing_char", - new String[] { String.valueOf(base) }), i); + "exception.mismatched_closing_char", new String[] + { String.valueOf(base) }), i); } int temp = stack.pop(); @@ -188,9 +190,9 @@ public class Rna * i (length of input string) */ throw new WUSSParseException(MessageManager.formatMessage( - "exception.mismatched_opening_char", - new String[] { String.valueOf(opening), - String.valueOf(stack.pop()) }), i); + "exception.mismatched_opening_char", new String[] + { String.valueOf(opening), String.valueOf(stack.pop()) }), + i); } } return pairs; @@ -438,8 +440,8 @@ public class Rna /* * catch things like <<..<<..>>..<<..>>>> | */ - int j = bps.size() - 1; - while (j >= 0) + int j = bps.size(); + while (--j >= 0) { int popen = bps.get(j).getBP5(); @@ -458,7 +460,6 @@ public class Rna break; } } - j -= 1; } // Put positions and helix information into the hashtable @@ -466,7 +467,7 @@ public class Rna helices.put(close, helix); // Record helix as featuregroup - result.add(new SequenceFeature("RNA helix", "", "", open, close, + result.add(new SequenceFeature("RNA helix", "", open, close, String.valueOf(helix))); lastopen = open;