java.util.SimpleDateFormat

Erik Poupaert erik.poupaert@chello.be
Tue Apr 22 22:01:00 GMT 2003


>>>> Could you write simple, obviously correct test cases that show the
>>>> problem?  Preferably in Mauve format?  That would help.

I've tried the following test case, but it works. So, it's not necessarily a
bug in ClassPath/java.util.Date. I haven't found a description, explanation
or tutorial on how to write a Mauve test case. This is the little test:



import java.util.Date;

public class BugDate
{
	//X --- GCJ STATIC LINKING
   private static final Class GNU_CALENDAR=gnu.java.locale.Calendar.class;
   private static final Class
GNU_LOCALEINFORMATION=gnu.java.locale.LocaleInformation.class;
	   //otherwise it fails out-of-the-box on minGW
	//X --- GCJ STATIC LINKING

	public static void main(String args[])
	{
		Date date1=new Date(101,1,3);
		System.out.println("original date=" + date1.toString());
		Date date2=new Date(date1.getYear(),date1.getMonth(),date1.getDate());
		System.out.println("copied date=" + date2.toString());
		if(date1.equals(date2))
		{
			System.out.println("copy successful");
		}
		else
		{
			System.out.println("copy failed");
		}
	}
}



More information about the Java mailing list