Skip to content

Commit 43c0cd1

Browse files
committed
Applied eclipse-ee4j#45 "Java Security Ultimate Security Repo Scanner 2023"
+ Applied the review of eclipse-ee4j#128 (comment).
1 parent d5b3261 commit 43c0cd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/ning/http/client/multipart/MultipartUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
import java.nio.channels.Selector;
3737
import java.nio.channels.SocketChannel;
3838
import java.nio.channels.WritableByteChannel;
39-
import java.security.SecureRandom;
4039
import java.util.List;
4140
import java.util.Random;
4241
import java.util.Set;
42+
import java.util.concurrent.ThreadLocalRandom;
4343

4444
public class MultipartUtils {
4545

@@ -97,7 +97,7 @@ public static MultipartBody newMultipartBody(List<Part> parts, FluentCaseInsensi
9797
}
9898

9999
private static byte[] generateMultipartBoundary() {
100-
Random rand = new SecureRandom();
100+
final Random rand = ThreadLocalRandom.current();
101101
byte[] bytes = new byte[rand.nextInt(11) + 30]; // a random size from 30 to 40
102102
for (int i = 0; i < bytes.length; i++) {
103103
bytes[i] = MULTIPART_CHARS[rand.nextInt(MULTIPART_CHARS.length)];

0 commit comments

Comments
 (0)