JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / analysis / scoremodels / FeatureDistanceModel.java
index 8545e94..38217e9 100644 (file)
@@ -55,20 +55,17 @@ public class FeatureDistanceModel extends DistanceScoreModel
   @Override
   public ScoreModelI getInstance(AlignmentViewPanel view)
   {
-    FeatureDistanceModel instance;
+    FeatureDistanceModel model;
     try
     {
-      instance = this.getClass().getDeclaredConstructor().newInstance();
-      instance.configureFromAlignmentView(view);
-      return instance;
+      model = this.getClass().newInstance();
+      model.configureFromAlignmentView(view);
+      return model;
     } catch (InstantiationException | IllegalAccessException e)
     {
       System.err.println("Error in " + getClass().getName()
               + ".getInstance(): " + e.getMessage());
       return null;
-    } catch (ReflectiveOperationException roe)
-    {
-      return null;
     }
   }
 
@@ -191,7 +188,7 @@ public class FeatureDistanceModel extends DistanceScoreModel
   protected Map<SeqCigar, Set<String>> findFeatureTypesAtColumn(
           SeqCigar[] seqs, int columnPosition)
   {
-    Map<SeqCigar, Set<String>> sfap = new HashMap<>();
+    Map<SeqCigar, Set<String>> sfap = new HashMap<SeqCigar, Set<String>>();
     for (SeqCigar seq : seqs)
     {
       int spos = seq.findPosition(columnPosition);
@@ -200,7 +197,7 @@ public class FeatureDistanceModel extends DistanceScoreModel
         /*
          * position is not a gap
          */
-        Set<String> types = new HashSet<>();
+        Set<String> types = new HashSet<String>();
         List<SequenceFeature> sfs = fr.findFeaturesAtResidue(
                 seq.getRefSeq(), spos);
         for (SequenceFeature sf : sfs)