X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2Fcore%2FAppData.java;h=d54bca73111cae0d8c2bf215a5d1a68f988314c9;hb=1890f014c0a312a7a2203c878e4802e3eb914e47;hp=90235c3bf66c802f4a6c3c4de560204bba8458e9;hpb=de558440c776d39285b02d970a21df7002e85a3c;p=vamsas.git diff --git a/src/uk/ac/vamsas/objects/core/AppData.java b/src/uk/ac/vamsas/objects/core/AppData.java index 90235c3..d54bca7 100644 --- a/src/uk/ac/vamsas/objects/core/AppData.java +++ b/src/uk/ac/vamsas/objects/core/AppData.java @@ -74,26 +74,73 @@ implements java.io.Serializable if (obj instanceof AppData) { AppData temp = (AppData)obj; + boolean thcycle; + boolean tmcycle; if (this._choiceValue != null) { if (temp._choiceValue == null) return false; - else if (!(this._choiceValue.equals(temp._choiceValue))) - return false; - } - else if (temp._choiceValue != null) + if (this._choiceValue != temp._choiceValue) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._choiceValue); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._choiceValue); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); }; + return false; + } + if (!thcycle) { + if (!this._choiceValue.equals(temp._choiceValue)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); + } + } + } else if (temp._choiceValue != null) return false; if (this._data != null) { if (temp._data == null) return false; - else if (!(java.util.Arrays.equals(this._data, temp._data))) - return false; - } - else if (temp._data != null) + if (this._data != temp._data) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._data); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._data); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._data); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._data); }; + return false; + } + if (!thcycle) { + if (!java.util.Arrays.equals(this._data, temp._data)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._data); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._data); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._data); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._data); + } + } + } else if (temp._data != null) return false; if (this._dataReference != null) { if (temp._dataReference == null) return false; - else if (!(this._dataReference.equals(temp._dataReference))) - return false; - } - else if (temp._dataReference != null) + if (this._dataReference != temp._dataReference) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dataReference); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dataReference); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference); }; + return false; + } + if (!thcycle) { + if (!this._dataReference.equals(temp._dataReference)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference); + } + } + } else if (temp._dataReference != null) return false; return true; } @@ -145,14 +192,20 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_choiceValue != null) { + if (_choiceValue != null + && !org.castor.util.CycleBreaker.startingToCycle(_choiceValue)) { result = 37 * result + _choiceValue.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_choiceValue); } - if (_data != null) { + if (_data != null + && !org.castor.util.CycleBreaker.startingToCycle(_data)) { result = 37 * result + _data.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_data); } - if (_dataReference != null) { + if (_dataReference != null + && !org.castor.util.CycleBreaker.startingToCycle(_dataReference)) { result = 37 * result + _dataReference.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_dataReference); } return result;