From 783fbd0b01eea0b485a8664221413ef5ade10e21 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 29 Jan 2019 11:17:48 +0000 Subject: [PATCH] JAL-3143 format alleles array for feature description --- src/jalview/ext/ensembl/EnsemblFeatures.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/jalview/ext/ensembl/EnsemblFeatures.java b/src/jalview/ext/ensembl/EnsemblFeatures.java index 9a45dda..744191d 100644 --- a/src/jalview/ext/ensembl/EnsemblFeatures.java +++ b/src/jalview/ext/ensembl/EnsemblFeatures.java @@ -176,7 +176,9 @@ class EnsemblFeatures extends EnsemblRestClient } /** - * Returns the first non-null attribute found (if any) as a string + * Returns the first non-null attribute found (if any) as a string, formatted + * suitably for display as feature description or tooltip. Answers null if + * none of the attribute keys is present. * * @param obj * @param keys @@ -191,7 +193,9 @@ class EnsemblFeatures extends EnsemblRestClient Object val = obj.get(key); if (val != null) { - String s = val.toString(); + String s = val instanceof JSONArray + ? JSONUtils.arrayToList((JSONArray) val) + : val.toString(); if (!s.isEmpty()) { return s; -- 1.7.10.2