From: amwaterhouse Date: Mon, 31 Oct 2005 15:52:49 +0000 (+0000) Subject: Catch numberformatexceptions X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=02a310e8406f7cfbb5cf7a6d56b0bcec43761b08;p=jalview.git Catch numberformatexceptions --- diff --git a/src/jalview/io/AlignFile.java b/src/jalview/io/AlignFile.java index 3a05402..5b94eb8 100755 --- a/src/jalview/io/AlignFile.java +++ b/src/jalview/io/AlignFile.java @@ -199,20 +199,27 @@ public abstract class AlignFile extends FileParse if (id.indexOf("/") > 0) { st = new StringTokenizer(id, "/"); + String limits=null; + try{ + if (st.countTokens() == 2) + { + id = st.nextToken(); - if (st.countTokens() == 2) - { - id = st.nextToken(); - - String tmp = st.nextToken(); + limits = st.nextToken(); - st = new StringTokenizer(tmp, "-"); + st = new StringTokenizer(limits, "-"); - if (st.countTokens() == 2) - { - seq.setStart( Integer.valueOf(st.nextToken()).intValue() ); - seq.setEnd( Integer.valueOf(st.nextToken()).intValue() ); + if (st.countTokens() == 2) + { + seq.setStart(Integer.valueOf(st.nextToken()).intValue()); + seq.setEnd(Integer.valueOf(st.nextToken()).intValue()); + } } + }catch(NumberFormatException ex) + { + // Problem parsing sequence limits. Just add it back to the + // Id so we dont lose this info + id += "/" + limits; } } seq.setName(id);