Thursday, January 31, 2013

Bug in SimpleDateFormat in OpenJDK

Good evening,

today I have found an interesting bug in OpenJDK. So I have the next code:

public class TestCalendar {

 public static void main(String argc[]) {
  Calendar cal = Calendar.getInstance();
  DateFormat sdf = new SimpleDateFormat("MMMMM");
  
  for (int i = 0; i < 12; i++) {
   cal.set(Calendar.MONTH, i);
   System.out.println(sdf.format(cal.getTime()));
  }
 }
}

When executing this code on

OpenJDK Runtime Environment (IcedTea7 2.3.4) (7u9-2.3.4-0ubuntu1.12.10.1)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)

The result is following:

January
March
March
April
May
June
July
August
September
October
November
December

Nice bug, I hope it is already reported, but will check if not.

Cheers!

Saturday, January 26, 2013

New page on my wiki!

Hello!

Today I would like to say that I created a new page on my wiki, named "Development" where I would like to store different solutions for some problems I have found or just some small pieces of code.

For example I start with uploading on my FTP the twitter bootstrap files, so to not download it each time.

Enjoy: http://ermicioi.info.md/wiki/index.php/Development