JAL-2792 include source in copy constructor; null pointer check
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 27 Oct 2017 09:52:56 +0000 (10:52 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 27 Oct 2017 09:52:56 +0000 (10:52 +0100)
src/jalview/datamodel/SequenceFeature.java

index a2d91b1..8f82a1a 100755 (executable)
@@ -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 = "<tr><td width=\"10%%\">%s</td><td width=\"50%%\">%s</td><td width=\"40%%\">%s</td></tr>";
+  private static final String ROW_DATA = "<tr><td>%s</td><td>%s</td><td>%s</td></tr>";
 
   /*
    * 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<String, Object>();
@@ -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
       {