JAL-1070 - [ not a real patch ] - include offending line number and content in output...
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Tue, 21 May 2013 13:12:15 +0000 (14:12 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 24 May 2013 14:10:54 +0000 (15:10 +0100)
src/jalview/io/AnnotationFile.java

index 45e6c47..a94bd3c 100755 (executable)
@@ -579,14 +579,19 @@ public class AnnotationFile
     {
       ex.printStackTrace();
       System.out.println("Problem reading annotation file: " + ex);
+      if (nlinesread>0) {
+        System.out.println("Last read line "+nlinesread+": '"+lastread+"' (first 80 chars) ...");
+      }
       return false;
     }
     return false;
   }
-
+  long nlinesread=0;
+  String lastread="";
   public boolean parseAnnotationFrom(AlignmentI al, BufferedReader in)
           throws Exception
   {
+    nlinesread = 0;
     boolean modified = false;
     String groupRef = null;
     Hashtable groupRefRows = new Hashtable();
@@ -631,6 +636,7 @@ public class AnnotationFile
       boolean jvAnnotationFile = false;
       while ((line = in.readLine()) != null)
       {
+        nlinesread++;lastread = new String(line);
         if (line.indexOf("#") == 0)
         {
           continue;
@@ -651,6 +657,7 @@ public class AnnotationFile
 
       while ((line = in.readLine()) != null)
       {
+        nlinesread++;lastread = new String(line);
         if (line.indexOf("#") == 0
                 || line.indexOf("JALVIEW_ANNOTATION") > -1
                 || line.length() == 0)