From 20ca25437594cfb22689e45641c683681e400e07 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 10 May 2018 11:34:23 +0100 Subject: [PATCH] JAL-2920 simplified logic and added corner cases for missing attributes (probably not needed but..) --- .../datamodel/xdb/uniprot/UniprotFeature.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/jalview/datamodel/xdb/uniprot/UniprotFeature.java b/src/jalview/datamodel/xdb/uniprot/UniprotFeature.java index 6102775..4c2ae24 100644 --- a/src/jalview/datamodel/xdb/uniprot/UniprotFeature.java +++ b/src/jalview/datamodel/xdb/uniprot/UniprotFeature.java @@ -51,13 +51,19 @@ public class UniprotFeature public String getDescription() { - return (description == null && variation == null && original == null) - ? null - : (description == null ? "" : description) - + ((variation != null) - ? "Variation: '" + variation + "' " + if (description == null && variation == null && original == null) + { + return null; + } + return (description == null ? "" : description) + + (variation != null + ? (description != null ? " " : "") + "Variation: '" + + variation + "'" : "") - + ((original != null) ? "Original: '" + original + "'" : ""); + + (original != null + ? ((description != null || variation != null) ? " " + : "") + "Original: '" + original + "'" + : ""); } public void setDescription(String d) -- 1.7.10.2