Skip to content

Commit

Permalink
fixed JacisTestHelper for all Java versions
Browse files Browse the repository at this point in the history
  • Loading branch information
JanWiemer committed Nov 3, 2023
1 parent 893a018 commit fd4cd1e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/test/java/org/jacis/testhelper/JacisTestHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import org.jacis.plugin.txadapter.local.JacisTransactionAdapterLocal;
import org.jacis.store.JacisStore;

import java.security.SecureRandom;

@SuppressWarnings("WeakerAccess")
public class JacisTestHelper {

Expand Down Expand Up @@ -95,8 +93,9 @@ public void resumeTx(JacisTransactionHandle tx) {
testTxAdapter.resumeTx(tx);
}

@java.lang.SuppressWarnings("java:S2245") // used only for test data generation
public long getRandBetween(long min, long max) {
return max <= min ? min : min + new SecureRandom().nextLong(max - min + 1);
return max <= min ? min : min + Math.round((max - min) * Math.random());
}

public void sleep(int ms) {
Expand Down

0 comments on commit fd4cd1e

Please sign in to comment.