diff options
Diffstat (limited to 'src/test/java/com/healthmarketscience/jackcess')
-rw-r--r-- | src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java b/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java index c6bda5b..a3eb46a 100644 --- a/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java @@ -19,7 +19,6 @@ package com.healthmarketscience.jackcess.impl.expr; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.Random; import com.healthmarketscience.jackcess.DatabaseBuilder; import com.healthmarketscience.jackcess.TestUtil; @@ -382,9 +381,7 @@ public class ExpressionatorTest extends TestCase private static final class TestEvalContext implements EvalContext { private final Value _thisVal; - private Random _defRnd; - private Random _rnd; - private long _rndSeed; + private final RandomContext _rndCtx = new RandomContext(); private TestEvalContext(Value thisVal) { _thisVal = thisVal; @@ -416,18 +413,8 @@ public class ExpressionatorTest extends TestCase throw new UnsupportedOperationException(); } - public Random getRandom(Integer seed) { - if(seed == null) { - if(_defRnd == null) { - _defRnd = new Random(System.currentTimeMillis()); - } - return _defRnd; - } - if((_rnd == null) || (seed != _rndSeed)) { - _rndSeed = seed; - _rnd = new Random(_rndSeed); - } - return _rnd; + public float getRandom(Integer seed) { + return _rndCtx.getRandom(seed); } } } |