Fix missing static imports of TimeUnit

This commit is contained in:
P0nk
2021-09-10 19:18:20 +02:00
parent cdc17ef3dd
commit 8b60684103
10 changed files with 40 additions and 28 deletions

View File

@@ -9,7 +9,8 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import static java.util.concurrent.TimeUnit.HOURS;
/**
* @author RonanLana
@@ -238,7 +239,7 @@ public class CodeCouponGenerator {
generatedKeys = null;
PreparedStatement ps = con.prepareStatement("INSERT IGNORE INTO `nxcode` (`code`, `expiration`) VALUES (?, ?)", Statement.RETURN_GENERATED_KEYS);
ps.setLong(2, currentTime + TimeUnit.HOURS.toMillis(recipe.duration));
ps.setLong(2, currentTime + HOURS.toMillis(recipe.duration));
for (int i = 0; i < recipe.quantity; i++) {
ps.setString(1, generateCouponCode());