X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fintervalstore%2Fnonc%2FIntervalStore.java;h=b010340bbcd09d7cd2e17b95636af66015940847;hb=e9a93e9bcdf6268703e502875c7f6c260ab39bf4;hp=405a4714828cb1dc48791a533db2a1472bf7a0d5;hpb=c769685cc0a0eead20b9ce9b5a3d0d96f664b6cb;p=jalview.git diff --git a/src/intervalstore/nonc/IntervalStore.java b/src/intervalstore/nonc/IntervalStore.java index 405a471..b010340 100644 --- a/src/intervalstore/nonc/IntervalStore.java +++ b/src/intervalstore/nonc/IntervalStore.java @@ -401,7 +401,7 @@ public class IntervalStore int pt0 = pt; while (--pt >= 0 && offsets[pt] == 0) { - ; + } if (pt < 0) { @@ -1350,26 +1350,15 @@ public class IntervalStore } /** - * CAUTION! This presumes that equalsInterval does check descriptions. Note - * that bartongroup.IntervalStoreJ does NOT do this and - * jalview.datamodel.features.SequenceFeature does not, either. But - * nonc.SimpleFeature in test DOES, because it overrides equalsInterval. - * - * The reason we do it this way is to avoid an unnecessary and costly test for - * obj instanceof IntervalI. - * - * Added by Mungo to use equals, but that requires use of instance checking, - * which is not significant in Java (apparently), but is a bigger deal in - * JavaScript. So here we have to hack - * bobhanson.IntervalStoreJ.nonc.InervalStore to bypass equals. + * Tests for instance equality without using {@code instanceof} * * @param i1 * @param i2 * @return + * @throws ClassCastException */ - boolean sameInterval(IntervalI i1, IntervalI i2) + protected boolean sameInterval(IntervalI i1, IntervalI i2) { - // avoiding equals() for JavaScript performance return ((SequenceFeature) i1).equals((SequenceFeature) i2, false); }