X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2Fscoremodels%2FFeatureDistanceModel.java;h=bcc085558a4beb19f18b3fe68ec95de58ad83177;hb=cd669a0e8c7b91b379bca8fe6e702cf0fcbd1ce0;hp=ddbaf73600e05204dc854519c81b72a93f967289;hpb=136c0793b90b72b928c4d77dc109dd5c644e00d3;p=jalview.git diff --git a/src/jalview/analysis/scoremodels/FeatureDistanceModel.java b/src/jalview/analysis/scoremodels/FeatureDistanceModel.java index ddbaf73..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; } } @@ -124,8 +127,8 @@ public class FeatureDistanceModel extends DistanceScoreModel /* * first record feature types in this column for each sequence */ - Map> sfap = findFeatureTypesAtColumn( - seqs, cpos); + Map> sfap = findFeatureTypesAtColumn(seqs, + cpos); /* * count feature types on either i'th or j'th sequence but not both @@ -188,7 +191,7 @@ public class FeatureDistanceModel extends DistanceScoreModel protected Map> findFeatureTypesAtColumn( SeqCigar[] seqs, int columnPosition) { - Map> sfap = new HashMap>(); + Map> sfap = new HashMap<>(); for (SeqCigar seq : seqs) { int spos = seq.findPosition(columnPosition); @@ -197,9 +200,9 @@ public class FeatureDistanceModel extends DistanceScoreModel /* * position is not a gap */ - Set types = new HashSet(); - List sfs = fr.findFeaturesAtResidue( - seq.getRefSeq(), spos); + Set types = new HashSet<>(); + List sfs = fr + .findFeaturesAtResidue(seq.getRefSeq(), spos, spos); for (SequenceFeature sf : sfs) { types.add(sf.getType());