resCorrected = resCorrected.setScale(0,RoundingMode.UP);
BigDecimal resPremiumed = resCorrected.multiply(premiumPercent);
resPremiumed = resPremiumed.setScale(0, RoundingMode.UP);
- return (resPremiumed.compareTo(BigDecimal.ZERO) == 0) || (resPremiumed == null) ? 0 : Integer.parseInt(resPremiumed.toString());
+ return (resPremiumed.compareTo(BigDecimal.ZERO) == 0) ? 0 : Integer.parseInt(resPremiumed.toString());
}
public static CompletableFuture<Integer> fanAsync(int score, int room, int center, int produce, int premium) {
public static int calcPRPFromScore(int score) {
BigDecimal scoreDecimal = BigDecimal.valueOf(score);
- scoreDecimal.divide(THAUSAND, RoundingMode.DOWN);
- return scoreDecimal.intValueExact();
+ return scoreDecimal.divide(THAUSAND, RoundingMode.DOWN).intValueExact();
}
}
private final static String CYCLEPATH = "generated/albumCycle.json";
private final static String DATEFORMAT = "YYYY/MM/dd";
- private final static SimpleDateFormat FORMAT = new SimpleDateFormat(DATEFORMAT);
private static Logger logger = LoggerFactory.getLogger(EstimateAlbumTypeCycle.class);
public final static String ALBUM_A = "ALBUM A";
return;
}
String inputDaysLeft = JOptionPane.showInputDialog("MASTER+のALBUM切り替えまであと何日ですか?\n(残り時間が表示されている場合は0を入力してください)");
- String dateDefinited = FORMAT.format(new Date());
+ final SimpleDateFormat format = new SimpleDateFormat(DATEFORMAT);
+ String dateDefinited = format.format(new Date());
property.setDateDefinited(dateDefinited);
property.setDaysLeft(Integer.parseInt(inputDaysLeft));
property.setType(inputType.equals("A") ? ALBUM_A : inputType.equals("B") ? ALBUM_B : ALBUM_C);
private String description;
private int estimateExitCode;
private CrashReportList<String> crashReportLines = new CrashReportList<>();
- private Random random = new Random(System.currentTimeMillis());
+ private static Random random = new Random(System.currentTimeMillis());
// constants
- private static final SimpleDateFormat FORMAT = new SimpleDateFormat("yy/MM/dd HH:mm");
private static final String DEFAULT_DESCRIPTION = "Unexpected Error";
private static final String[] EASTER_LINES = {
"// It will need to do more test?",
private String outputReport() {
crashReportLines.emptyLine();
- crashReportLines.add("Time: " + FORMAT.format(new Date()));
+ final SimpleDateFormat format = new SimpleDateFormat("yy/MM/dd HH:mm");
+ crashReportLines.add("Time: " + format.format(new Date()));
crashReportLines.add("Description: " + description);
crashReportLines.emptyLine();
LOG.debug("Gathering exception informations.");