From: gmungoc Date: Fri, 27 Oct 2017 09:52:56 +0000 (+0100) Subject: JAL-2792 include source in copy constructor; null pointer check X-Git-Tag: Release_2_11_0~177 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3fce1409d8d49829024e566325b6cf96008fa2a2;p=jalview.git JAL-2792 include source in copy constructor; null pointer check --- 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 {