jfree/jfreechart-fse

testParseMonth() in MonthTest.java fails

FlorianFratte opened this issue · 1 comments

Hi!

The Unit test for parseMonth with the month name fails if the system locale is not english

Example:

month = Month.parseMonth("March 1993");

will fail for a system set to "german"
To make the test pass (or the function work) you have to provide the german month name:

month = Month.parseMonth("März 1993");

I think the root cause of this issue is new SimpleDateFormat().getDateFormatSymbols(); in SerialDate.java

My proposal is to set the locale setting to ENGLISH so that it's consistent on different machines:

DateFormatSymbols dfs=new SimpleDateFormat().getDateFormatSymbols();
System.out.println(dfs.getMonths()[2]);
// -> März


DateFormatSymbols dfs_en=new SimpleDateFormat("dd/MM/yyyy hh:mm:ss",Locale.ENGLISH).getDateFormatSymbols();
System.out.println(dfs_en.getMonths()[2]);
// -> March

KR
Florian

Sorry, just realized that there already exists an issue for this