X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2Fscoremodels%2FFeatureDistanceModel.java;h=bcc085558a4beb19f18b3fe68ec95de58ad83177;hb=6ca8a32d88328b8f2162512f41c657c87e131045;hp=bfecd65c074f37de1847da2d594aafb5e7d1c2ec;hpb=3740241b6d0dfa109dc81847afe58f17497c39e8;p=jalview.git diff --git a/src/jalview/analysis/scoremodels/FeatureDistanceModel.java b/src/jalview/analysis/scoremodels/FeatureDistanceModel.java index bfecd65..bcc0855 100644 --- a/src/jalview/analysis/scoremodels/FeatureDistanceModel.java +++ b/src/jalview/analysis/scoremodels/FeatureDistanceModel.java @@ -58,14 +58,17 @@ public class FeatureDistanceModel extends DistanceScoreModel FeatureDistanceModel instance; try { - instance = this.getClass().newInstance(); + instance = this.getClass().getDeclaredConstructor().newInstance(); instance.configureFromAlignmentView(view); return instance; } catch (InstantiationException | IllegalAccessException e) { - System.err.println("Error in " + getClass().getName() + jalview.bin.Console.errPrintln("Error in " + getClass().getName() + ".getInstance(): " + e.getMessage()); return null; + } catch (ReflectiveOperationException roe) + { + return null; } } @@ -198,8 +201,8 @@ public class FeatureDistanceModel extends DistanceScoreModel * position is not a gap */ Set types = new HashSet<>(); - List sfs = fr.findFeaturesAtResidue( - seq.getRefSeq(), spos, spos); + List sfs = fr + .findFeaturesAtResidue(seq.getRefSeq(), spos, spos); for (SequenceFeature sf : sfs) { types.add(sf.getType());