From 323663120848253cb367f13d7e470790ec451219 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 23 May 2013 11:58:20 +0100 Subject: [PATCH] JAL-1295 relaxed test for Annotation element equivalence and javadoc to clarify format for Annotation.toString --- src/jalview/datamodel/Annotation.java | 9 +++++++++ test/jalview/io/StockholmFileTest.java | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/jalview/datamodel/Annotation.java b/src/jalview/datamodel/Annotation.java index c9a623b..f692234 100755 --- a/src/jalview/datamodel/Annotation.java +++ b/src/jalview/datamodel/Annotation.java @@ -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() { diff --git a/test/jalview/io/StockholmFileTest.java b/test/jalview/io/StockholmFileTest.java index d831b08..a0c9336 100644 --- a/test/jalview/io/StockholmFileTest.java +++ b/test/jalview/io/StockholmFileTest.java @@ -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)))) -- 1.7.10.2