X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2Fcore%2FUser.java;fp=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2Fcore%2FUser.java;h=0339959920f245b649619b07f1104e44b8520eb3;hb=1890f014c0a312a7a2203c878e4802e3eb914e47;hp=50f860ec8ad6fc992ccd57c6920f9383238943f6;hpb=de558440c776d39285b02d970a21df7002e85a3c;p=vamsas.git diff --git a/src/uk/ac/vamsas/objects/core/User.java b/src/uk/ac/vamsas/objects/core/User.java index 50f860e..0339959 100644 --- a/src/uk/ac/vamsas/objects/core/User.java +++ b/src/uk/ac/vamsas/objects/core/User.java @@ -69,19 +69,51 @@ implements java.io.Serializable if (obj instanceof User) { User temp = (User)obj; + boolean thcycle; + boolean tmcycle; if (this._fullname != null) { if (temp._fullname == null) return false; - else if (!(this._fullname.equals(temp._fullname))) - return false; - } - else if (temp._fullname != null) + if (this._fullname != temp._fullname) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._fullname); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._fullname); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname); }; + return false; + } + if (!thcycle) { + if (!this._fullname.equals(temp._fullname)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname); + } + } + } else if (temp._fullname != null) return false; if (this._organization != null) { if (temp._organization == null) return false; - else if (!(this._organization.equals(temp._organization))) - return false; - } - else if (temp._organization != null) + if (this._organization != temp._organization) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._organization); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._organization); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._organization); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization); }; + return false; + } + if (!thcycle) { + if (!this._organization.equals(temp._organization)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._organization); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._organization); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization); + } + } + } else if (temp._organization != null) return false; return true; } @@ -121,11 +153,15 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_fullname != null) { + if (_fullname != null + && !org.castor.util.CycleBreaker.startingToCycle(_fullname)) { result = 37 * result + _fullname.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_fullname); } - if (_organization != null) { + if (_organization != null + && !org.castor.util.CycleBreaker.startingToCycle(_organization)) { result = 37 * result + _organization.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_organization); } return result;