clean up this.

This commit is contained in:
Dave
2015-11-29 11:53:53 +02:00
parent 9108b2720a
commit 495a227da1

View File

@@ -78,27 +78,27 @@ public final class NoSession implements Serializable {
public NoState touchState() throws NoSessionConfirmedException, NoSessionExpiredException { public NoState touchState() throws NoSessionConfirmedException, NoSessionExpiredException {
check(); check();
if (this.original == null) { if (original == null) {
if (this.state != NoState.AWAITING_CONFIRMATION) { if (state != NoState.AWAITING_CONFIRMATION) {
this.state = NoState.MODIFIED; state = NoState.MODIFIED;
} }
} else { } else {
String originalHash = this.original.createHashString(); String originalHash = this.original.createHashString();
String currentHash = this.current.createHashString(); String currentHash = this.current.createHashString();
if (originalHash.equals(currentHash)) { if (originalHash.equals(currentHash)) {
this.state = NoState.IDLE; state = NoState.IDLE;
} else if (this.state != NoState.AWAITING_CONFIRMATION) { } else if (this.state != NoState.AWAITING_CONFIRMATION) {
this.state = NoState.MODIFIED; state = NoState.MODIFIED;
} }
} }
return this.state; return state;
} }
public byte[] initiateSaveAttempt(char[] password) public byte[] initiateSaveAttempt(char[] password)
throws NoSessionConfirmedException, NoSessionExpiredException { throws NoSessionConfirmedException, NoSessionExpiredException {
touchState(); touchState();
this.state = NoState.AWAITING_CONFIRMATION; this.state = NoState.AWAITING_CONFIRMATION;
byte[] file = this.current.createFile(password); byte[] file = current.createFile(password);
NoUtil.wipeChars(password); NoUtil.wipeChars(password);
return file; return file;
} }