clean up this.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user