From 8d20883646e6a422e617b489f00671edb3419471 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 15 Jun 2015 17:06:51 +0100 Subject: [PATCH] JAL-1775 patch regression bug when displayChar is null and secondaryStructure contains secondary structure info --- src/jalview/datamodel/AlignmentAnnotation.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 4499038..7966f5e 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -502,9 +502,13 @@ public class AlignmentAnnotation public char charAt(int index) { return ((index + offset < 0) || (index + offset) >= max - || annotations[index + offset] == null || (annotations[index - + offset].secondaryStructure <= ' ') ? ' ' - : annotations[index + offset].displayCharacter.charAt(0)); + || annotations[index + offset] == null + || (annotations[index + offset].secondaryStructure <= ' ') ? ' ' + : annotations[index + offset].displayCharacter == null + || annotations[index + offset].displayCharacter + .length() == 0 ? annotations[index + offset].secondaryStructure + : annotations[index + offset].displayCharacter + .charAt(0)); } @Override @@ -516,7 +520,9 @@ public class AlignmentAnnotation for (int i = offset; i < mx; i++) { string[i] = (annotations[i] == null || (annotations[i].secondaryStructure <= 32)) ? ' ' - : annotations[i].displayCharacter.charAt(0); + : (annotations[i].displayCharacter == null + || annotations[i].displayCharacter.length() == 0 ? annotations[i].secondaryStructure + : annotations[i].displayCharacter.charAt(0)); } return new String(string); } -- 1.7.10.2