Skip to content

Commit 8a9aeb8

Browse files
committed
remove forbidden api usage
Signed-off-by: Kaushal Kumar <[email protected]>
1 parent 512b0ca commit 8a9aeb8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

libs/autotagging-commons/src/test/java/org/opensearch/rule/storage/AttributeValueStoreTests.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313

1414
import java.util.ArrayList;
1515
import java.util.List;
16-
import java.util.Random;
1716

1817
public class AttributeValueStoreTests extends OpenSearchTestCase {
1918

2019
AttributeValueStore<String, String> subjectUnderTest;
2120
final static String ALPHA_NUMERIC = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
22-
final static Random random = new Random();
2321

2422
public void setUp() throws Exception {
2523
super.setUp();
@@ -76,10 +74,10 @@ public void testConcurrentUpdatesAndReads() {
7674
}
7775

7876
public static String generateRandom(int maxLength) {
79-
int length = random.nextInt(maxLength) + 1; // +1 to avoid length 0
77+
int length = random().nextInt(maxLength) + 1; // +1 to avoid length 0
8078
StringBuilder sb = new StringBuilder(length);
8179
for (int i = 0; i < length; i++) {
82-
sb.append(ALPHA_NUMERIC.charAt(random.nextInt(ALPHA_NUMERIC.length())));
80+
sb.append(ALPHA_NUMERIC.charAt(random().nextInt(ALPHA_NUMERIC.length())));
8381
}
8482
return sb.toString();
8583
}

0 commit comments

Comments
 (0)