X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2Fcore%2FInput.java;h=b5b2de93238f0b94887214a8026ab79ae2ad6a26;hb=1890f014c0a312a7a2203c878e4802e3eb914e47;hp=3ad7a8eb200a2010193eb8f5632fdd851b7793d6;hpb=de558440c776d39285b02d970a21df7002e85a3c;p=vamsas.git diff --git a/src/uk/ac/vamsas/objects/core/Input.java b/src/uk/ac/vamsas/objects/core/Input.java index 3ad7a8e..b5b2de9 100644 --- a/src/uk/ac/vamsas/objects/core/Input.java +++ b/src/uk/ac/vamsas/objects/core/Input.java @@ -109,19 +109,51 @@ implements java.io.Serializable if (obj instanceof Input) { Input temp = (Input)obj; + boolean thcycle; + boolean tmcycle; if (this._name != null) { if (temp._name == null) return false; - else if (!(this._name.equals(temp._name))) - return false; - } - else if (temp._name != null) + if (this._name != temp._name) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); }; + return false; + } + if (!thcycle) { + if (!this._name.equals(temp._name)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + } + } + } else if (temp._name != null) return false; if (this._objRef != null) { if (temp._objRef == null) return false; - else if (!(this._objRef.equals(temp._objRef))) - return false; - } - else if (temp._objRef != null) + if (this._objRef != temp._objRef) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._objRef); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._objRef); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef); }; + return false; + } + if (!thcycle) { + if (!this._objRef.equals(temp._objRef)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef); + } + } + } else if (temp._objRef != null) return false; return true; } @@ -207,11 +239,15 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_name != null) { + if (_name != null + && !org.castor.util.CycleBreaker.startingToCycle(_name)) { result = 37 * result + _name.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_name); } - if (_objRef != null) { + if (_objRef != null + && !org.castor.util.CycleBreaker.startingToCycle(_objRef)) { result = 37 * result + _objRef.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_objRef); } return result;