Skip to content

Commit

Permalink
πŸ‘ rand bug πŸ‘
Browse files Browse the repository at this point in the history
  • Loading branch information
eformat committed Dec 27, 2021
1 parent f14ad1c commit e6f050e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/app/petbattle/CatResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.io.InputStream;
import java.security.SecureRandom;
import java.time.Duration;
import java.util.*;

Expand All @@ -48,6 +49,8 @@ public class CatResource {
@ConfigProperty(name = "app.petbattle.nsff.limit", defaultValue = "0.6")
Double nsffLimit = 0.6;

private Random rand = new SecureRandom();

/**
* List all Cats including images
*
Expand Down Expand Up @@ -230,7 +233,6 @@ public void loadlitter() {
return;
final List<String> catList = Arrays.asList("cat1.jpeg", "cat2.jpeg", "cat3.jpeg", "cat4.jpeg", "cat5.jpeg", "cat6.jpeg",
"cat7.jpeg", "cat8.jpeg", "cat9.jpeg", "cat10.jpeg", "cat11.jpeg", "cat12.jpeg", "dog1.jpeg");
Random rand = new Random();
for (String tc : catList) {
try {
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tc);
Expand Down

0 comments on commit e6f050e

Please sign in to comment.