X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2Fcore%2FParam.java;h=e9cece2ca74380455552662768cfed9a1e7baaf2;hb=1890f014c0a312a7a2203c878e4802e3eb914e47;hp=744dba59d4b4c7fcaa34ae3626ae67767a89f8a6;hpb=de558440c776d39285b02d970a21df7002e85a3c;p=vamsas.git diff --git a/src/uk/ac/vamsas/objects/core/Param.java b/src/uk/ac/vamsas/objects/core/Param.java index 744dba5..e9cece2 100644 --- a/src/uk/ac/vamsas/objects/core/Param.java +++ b/src/uk/ac/vamsas/objects/core/Param.java @@ -78,26 +78,73 @@ implements java.io.Serializable if (obj instanceof Param) { Param temp = (Param)obj; + boolean thcycle; + boolean tmcycle; if (this._content != null) { if (temp._content == null) return false; - else if (!(this._content.equals(temp._content))) - return false; - } - else if (temp._content != null) + if (this._content != temp._content) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); }; + return false; + } + if (!thcycle) { + if (!this._content.equals(temp._content)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + } + } + } else if (temp._content != null) return false; 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._type != null) { if (temp._type == null) return false; - else if (!(this._type.equals(temp._type))) - return false; - } - else if (temp._type != null) + if (this._type != temp._type) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._type); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._type); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._type); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); }; + return false; + } + if (!thcycle) { + if (!this._type.equals(temp._type)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._type); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._type); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); + } + } + } else if (temp._type != null) return false; return true; } @@ -153,14 +200,20 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_content != null) { + if (_content != null + && !org.castor.util.CycleBreaker.startingToCycle(_content)) { result = 37 * result + _content.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_content); } - if (_name != null) { + if (_name != null + && !org.castor.util.CycleBreaker.startingToCycle(_name)) { result = 37 * result + _name.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_name); } - if (_type != null) { + if (_type != null + && !org.castor.util.CycleBreaker.startingToCycle(_type)) { result = 37 * result + _type.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_type); } return result;