equalsIgnoreCase CLUSTAL
authoramwaterhouse <Andrew Waterhouse>
Mon, 31 Oct 2005 15:53:08 +0000 (15:53 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 31 Oct 2005 15:53:08 +0000 (15:53 +0000)
src/jalview/io/ClustalFile.java

index 981e3c9..e72e0df 100755 (executable)
@@ -55,8 +55,9 @@ public class ClustalFile
 \r
     Vector headers = new Vector();\r
     Hashtable seqhash = new Hashtable();\r
-\r
-    String line;\r
+    StringBuffer tempseq;\r
+    String line, id;\r
+    StringTokenizer str;\r
 \r
     try\r
     {\r
@@ -64,14 +65,13 @@ public class ClustalFile
       {\r
         if (line.indexOf(" ") != 0)\r
         {\r
-          StringTokenizer str = new StringTokenizer(line, " ");\r
-          String id = "";\r
+          str = new StringTokenizer(line, " ");\r
 \r
           if (str.hasMoreTokens())\r
           {\r
             id = str.nextToken();\r
 \r
-            if (id.equals("CLUSTAL"))\r
+            if (id.equalsIgnoreCase("CLUSTAL"))\r
             {\r
               flag = true;\r
             }\r
@@ -79,8 +79,6 @@ public class ClustalFile
             {\r
               if (flag)\r
               {\r
-                StringBuffer tempseq;\r
-\r
                 if (seqhash.containsKey(id))\r
                 {\r
                   tempseq = (StringBuffer) seqhash.get(id);\r
@@ -103,6 +101,8 @@ public class ClustalFile
               }\r
             }\r
           }\r
+          else\r
+            flag = true;\r
         }\r
       }\r
     }\r