/*
 * $Id$
 * $URL$
 */

package org.subethamail.common;

import java.sql.Timestamp;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;



/**
 * Utility methods to work with date and time objects.
 * 
 * @author Jeff Schnitzer
 */
public class TimeUtils
{
	/** */
	@SuppressWarnings("unused")
	private final static Logger log = LoggerFactory.getLogger(TimeUtils.class);

	/** default constructor prevents util class from being created. */
	private TimeUtils() {}

	/**
	 * Equivalent of compareTo() but actually works because Sun
	 * fucked up the JDK.  See:
	 * 
	 * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103041
	 * http://forum.hibernate.org/viewtopic.php?t=959124
	 * http://forum.hibernate.org/viewtopic.php?t=925275
	 * http://forum.hibernate.org/viewtopic.php?t=927602
	 */
	public static int compareDates(Date date1, Date date2)
	{
		if (date1 instanceof Timestamp)
		{
			if (date2 instanceof Timestamp)
			{
				return date1.compareTo(date2);
			}
			else
			{
				return date1.compareTo(new Timestamp(date2.getTime()));
			}
		}
		else
		{
			if (date2 instanceof Timestamp)
			{
				return new Timestamp(date1.getTime()).compareTo(date2);
			}
			else
			{
				return date1.compareTo(date2);
			}
		}
	}
}

@@ -116,69 +116,8 @@
 %0D%0A%0D%0A
-import org.slf4j.Logger;%0D%0Aimport org.slf4j.LoggerFactory;%0D%0A%0D%0A
 %0D%0A%0D%0A
@@ -245,127 +245,8 @@
 %0A%7B%0D%0A
-%09/** */%0D%0A%09@SuppressWarnings(%22unused%22)%0D%0A%09private final static Logger log = LoggerFactory.getLogger(TimeUtils.class);%0D%0A%0D%0A
 %09/**

switch logging framework