This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: java.util.SimpleDateFormat


>>>> 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");
		}
	}
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]