May 24, 2006
cintoo Messages moved to Java 5
I moved cintoo Messages to JDK 1.5 because of several reasons. I know this will reduce the potential user base, but with Mustang on the horizon, a lot of projects are moving to 1.5 now or in the near feature. Beside I really like generics (being a strong opposer for some years, though IDEA could make code less noisy and hide generics completely) and Java 5 has varargs and outoboxing. This makes dealing with String formatting much easier.
Instead of:
format(”{0} of {1} files removed”,
new Integer[] { new Integer(3), new Integer(7) });
new Integer[] { new Integer(3), new Integer(7) });
(there was a helper in Messages which took int[] )
now you can write
format(”{0} of {1} files removed”, 3, 7);
which is mapped to
public String format(String text, Object… args);
The Object… is syntactic sugar and is automatically mapped from “3, 7″ to Object[] with
autoboxing 3 and 7 to objects.