X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2Fcore%2FDataSetAnnotations.java;h=861f0fe2dbd0c64ab1efeefd8ed4e64faba13000;hb=1890f014c0a312a7a2203c878e4802e3eb914e47;hp=39aa93991cb70e70c77a7184addb8483bdd2cf6a;hpb=de558440c776d39285b02d970a21df7002e85a3c;p=vamsas.git diff --git a/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java b/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java index 39aa939..861f0fe 100644 --- a/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java +++ b/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java @@ -109,19 +109,51 @@ implements java.io.Serializable if (obj instanceof DataSetAnnotations) { DataSetAnnotations temp = (DataSetAnnotations)obj; + boolean thcycle; + boolean tmcycle; if (this._seqRef != null) { if (temp._seqRef == null) return false; - else if (!(this._seqRef.equals(temp._seqRef))) - return false; - } - else if (temp._seqRef != null) + if (this._seqRef != temp._seqRef) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._seqRef); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._seqRef); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef); }; + return false; + } + if (!thcycle) { + if (!this._seqRef.equals(temp._seqRef)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef); + } + } + } else if (temp._seqRef != null) 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; } @@ -207,11 +239,15 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_seqRef != null) { + if (_seqRef != null + && !org.castor.util.CycleBreaker.startingToCycle(_seqRef)) { result = 37 * result + _seqRef.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_seqRef); } - 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;