Do these methods have same output?
- by devrimbaris
protected synchronized boolean isTimeoutOccured(Duration timeoutDuration) {
DateTime now = new DateTime();
if (timeoutOccured == false) {
if (new Duration(requestTime.getMillis(), now.getMillis()).compareTo(timeoutDuration) > 0) {
timeoutOccured = true;
}
}
return timeoutOccured;
}
protected boolean isTimeoutOccured2(Duration timeoutDuration) {
return atomicTimeOut.compareAndSet(false, new Duration(requestTime.getMillis(), new DateTime().getMillis()).compareTo(timeoutDuration) > 0);
}