From 5fc9a342a1445c73c86c4910c6ac0918267cbb14 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 12 Nov 2013 12:51:03 +0000 Subject: [PATCH] * make sure long/int overflow issues are resolved --- .../sourceforge/filebot/web/AbstractCachedResource.java | 8 +++++--- source/net/sourceforge/tuned/FileUtilities.java | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/source/net/sourceforge/filebot/web/AbstractCachedResource.java b/source/net/sourceforge/filebot/web/AbstractCachedResource.java index 80bfcdb2..b37d02ba 100644 --- a/source/net/sourceforge/filebot/web/AbstractCachedResource.java +++ b/source/net/sourceforge/filebot/web/AbstractCachedResource.java @@ -12,9 +12,11 @@ import net.sf.ehcache.Element; public abstract class AbstractCachedResource { - public static final long ONE_MONTH = 30 * 24 * 60 * 60 * 1000L; - public static final long ONE_WEEK = 7 * 24 * 60 * 60 * 1000L; - public static final long ONE_DAY = 24 * 60 * 60 * 1000L; + public static final long ONE_MINUTE = 60 * 1000; + public static final long ONE_HOUR = 60 * ONE_MINUTE; + public static final long ONE_DAY = 24 * ONE_HOUR; + public static final long ONE_WEEK = 7 * ONE_DAY; + public static final long ONE_MONTH = 30 * ONE_DAY; private String resource; private Class type; diff --git a/source/net/sourceforge/tuned/FileUtilities.java b/source/net/sourceforge/tuned/FileUtilities.java index aa103138..bde3c45c 100644 --- a/source/net/sourceforge/tuned/FileUtilities.java +++ b/source/net/sourceforge/tuned/FileUtilities.java @@ -536,8 +536,8 @@ public final class FileUtilities { } public static final long KILO = 1024; - public static final long MEGA = KILO * 1024; - public static final long GIGA = MEGA * 1024; + public static final long MEGA = 1024 * KILO; + public static final long GIGA = 1024 * MEGA; public static String formatSize(long size) { if (size >= MEGA)