if (obj instanceof LockFile) {
LockFile temp = (LockFile)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;
return true;
}
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);
}
return result;