JAL-1295 relaxed test for Annotation element equivalence and javadoc to clarify forma...
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Thu, 23 May 2013 10:58:20 +0000 (11:58 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 24 May 2013 14:10:55 +0000 (15:10 +0100)
src/jalview/datamodel/Annotation.java
test/jalview/io/StockholmFileTest.java

index c9a623b..f692234 100755 (executable)
@@ -122,6 +122,15 @@ public class Annotation
     this(null, null, ' ', val);
   }
 
+  /**
+   * human readable representation of an annotation row element.
+   *
+   * Format is 'display Char','secondary Structure
+   * Char',"description",score,[colourstring]
+   *
+   * fields may be missing if they are null, whitespace, or equivalent to
+   * Float.NaN
+   */
   @Override
   public String toString()
   {
index d831b08..a0c9336 100644 (file)
@@ -277,9 +277,9 @@ public class StockholmFileTest
       if (an_or != null
               && an_new!= null)
       {
-        if (!an_or.displayCharacter
-                .equals(an_new.displayCharacter)
-                || an_or.secondaryStructure != an_new.secondaryStructure
+        if (!an_or.displayCharacter.trim()
+                .equals(an_new.displayCharacter.trim())
+                || !(""+an_or.secondaryStructure).trim().equals((""+an_new.secondaryStructure).trim())
                 || (an_or.description != an_new.description && (an_or.description == null
                         || an_new.description == null || !an_or.description
                           .equals(an_new.description))))