Skip to content

Commit 6651706

Browse files
committed
Altered BigIntegerInteractiveModification to only ask once for a Value and not every time get Value is called
1 parent 7bdf4ea commit 6651706

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/java/de/rub/nds/modifiablevariable/biginteger/BigIntegerModificationFactory.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,17 @@ public static VariableModification<BigInteger> explicitValueFromFile(int value)
9292
/*
9393
* Interactive modification
9494
*/
95-
9695
private static BigIntegerInteractiveModification.InteractiveBigIntegerModification standardInteractiveModification = new BigIntegerInteractiveModification.InteractiveBigIntegerModification() {
96+
private BigInteger value;
97+
9798
@Override
9899
public BigInteger modify(BigInteger oldVal) {
99-
System.out.println("Enter new value for BigInt: ");
100-
return new Scanner(System.in).nextBigInteger();
100+
if (value == null) {
101+
System.out.println("Enter new value for BigInt: ");
102+
value = new Scanner(System.in).nextBigInteger();
103+
}
104+
return value;
105+
101106
}
102107
};
103108

0 commit comments

Comments
 (0)