From 3fce1409d8d49829024e566325b6cf96008fa2a2 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 27 Oct 2017 10:52:56 +0100 Subject: [PATCH] JAL-2792 include source in copy constructor; null pointer check --- src/jalview/datamodel/SequenceFeature.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/jalview/datamodel/SequenceFeature.java b/src/jalview/datamodel/SequenceFeature.java index a2d91b1..8f82a1a 100755 --- a/src/jalview/datamodel/SequenceFeature.java +++ b/src/jalview/datamodel/SequenceFeature.java @@ -55,7 +55,7 @@ public class SequenceFeature implements FeatureLocationI // private key for ENA location designed not to conflict with real GFF data private static final String LOCATION = "!Location"; - private static final String ROW_DATA = "%s%s%s"; + private static final String ROW_DATA = "%s%s%s"; /* * map of otherDetails special keys, and their value fields' delimiter @@ -179,6 +179,8 @@ public class SequenceFeature implements FeatureLocationI this(newType, sf.getDescription(), newBegin, newEnd, newScore, newGroup); + this.source = sf.source; + if (sf.otherDetails != null) { otherDetails = new HashMap(); @@ -660,9 +662,10 @@ public class SequenceFeature implements FeatureLocationI return true; } - FeatureAttributeType attributeType = metadata.getAttributeType(key); - if (attributeType == FeatureAttributeType.Float - || attributeType.equals(FeatureAttributeType.Integer)) + FeatureAttributeType attType = metadata.getAttributeType(key); + if (attType != null + && (attType == FeatureAttributeType.Float || attType + .equals(FeatureAttributeType.Integer))) { try { -- 1.7.10.2