Skip to content

Commit

Permalink
Change behaviour of reduceToOriginalValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
C0D3D3V committed Dec 12, 2024
1 parent d613cdd commit ad139d1
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,18 @@ public E getValue() {
return getOriginalValue();
}

/**
* Sets the original value to the value changed by the modification. The modification is then
* set to null, to reduce the modifiable variable to the original value.
*
* <p>createRandomModification is ignored
*/
public void reduceToOriginalValue(boolean evenWithNullOriginalValue) {
if (evenWithNullOriginalValue || getOriginalValue() != null) {
setOriginalValue(getValue());
if (modification != null) {
setOriginalValue(modification.modify(getOriginalValue()));
modification = null;
}
}
}

Expand Down

0 comments on commit ad139d1

Please sign in to comment.