Added extra catches to user state change
This commit is contained in:
@@ -64,11 +64,15 @@ public final class NoSession implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void check() throws NoSessionConfirmedException, NoSessionExpiredException {
|
public void check() throws NoSessionConfirmedException, NoSessionExpiredException {
|
||||||
if (this.state == NoState.CONFIRMED) {
|
if (state == NoState.CONFIRMED) {
|
||||||
throw new NoSessionConfirmedException();
|
throw new NoSessionConfirmedException();
|
||||||
} else if (this.state == NoState.CLOSED || System.currentTimeMillis() > this.expiry) {
|
} else if (state == NoState.CLOSED || System.currentTimeMillis() > expiry) {
|
||||||
this.state = NoState.CLOSED;
|
state = NoState.CLOSED;
|
||||||
throw new NoSessionExpiredException();
|
throw new NoSessionExpiredException();
|
||||||
|
} else if (state == NoState.IDLE
|
||||||
|
&& (current.getNoActions().size() > 0
|
||||||
|
|| current.createHashString().equals(original.createHashString()))) {
|
||||||
|
state = NoState.MODIFIED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +143,7 @@ public final class NoSession implements Serializable {
|
|||||||
|
|
||||||
public NoUser getNoUser() throws NoSessionConfirmedException, NoSessionExpiredException {
|
public NoUser getNoUser() throws NoSessionConfirmedException, NoSessionExpiredException {
|
||||||
check();
|
check();
|
||||||
return this.current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NoUser getNoUserSafe() {
|
public NoUser getNoUserSafe() {
|
||||||
|
|||||||
Reference in New Issue
Block a user