* make sure long/int overflow issues are resolved

This commit is contained in:
Reinhard Pointner 2013-11-12 12:51:03 +00:00
parent 9eee85909b
commit 5fc9a342a1
2 changed files with 7 additions and 5 deletions

View File

@ -12,9 +12,11 @@ import net.sf.ehcache.Element;
public abstract class AbstractCachedResource<R, T extends Serializable> { public abstract class AbstractCachedResource<R, T extends Serializable> {
public static final long ONE_MONTH = 30 * 24 * 60 * 60 * 1000L; public static final long ONE_MINUTE = 60 * 1000;
public static final long ONE_WEEK = 7 * 24 * 60 * 60 * 1000L; public static final long ONE_HOUR = 60 * ONE_MINUTE;
public static final long ONE_DAY = 24 * 60 * 60 * 1000L; 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 String resource;
private Class<T> type; private Class<T> type;

View File

@ -536,8 +536,8 @@ public final class FileUtilities {
} }
public static final long KILO = 1024; public static final long KILO = 1024;
public static final long MEGA = KILO * 1024; public static final long MEGA = 1024 * KILO;
public static final long GIGA = MEGA * 1024; public static final long GIGA = 1024 * MEGA;
public static String formatSize(long size) { public static String formatSize(long size) {
if (size >= MEGA) if (size >= MEGA)