X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2Fcore%2FAlignmentSequenceAnnotation.java;h=7494819c25fc7146c6a10454793fda74fb29637a;hb=f5306591821b5f6d4e381ff30b647bd149d51f43;hp=64417fe7320d10e2bf724e392d74ca92c920f974;hpb=ac12127b5cf22bb34b6042e543d506894164a94c;p=vamsas.git diff --git a/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java index 64417fe..7494819 100644 --- a/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java +++ b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java @@ -87,16 +87,33 @@ implements java.io.Serializable if (obj instanceof AlignmentSequenceAnnotation) { AlignmentSequenceAnnotation temp = (AlignmentSequenceAnnotation)obj; + boolean thcycle; + boolean tmcycle; if (this._graph != temp._graph) return false; if (this._has_graph != temp._has_graph) return false; if (this._provenance != null) { if (temp._provenance == null) return false; - else if (!(this._provenance.equals(temp._provenance))) - return false; - } - else if (temp._provenance != null) + if (this._provenance != temp._provenance) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); }; + return false; + } + if (!thcycle) { + if (!this._provenance.equals(temp._provenance)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + } + } + } else if (temp._provenance != null) return false; return true; } @@ -154,8 +171,10 @@ implements java.io.Serializable long tmp; result = 37 * result + (_graph?0:1); - if (_provenance != null) { + if (_provenance != null + && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) { result = 37 * result + _provenance.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_provenance); } return result;