Code Monkeyism

Programming is hard by Stephan Schmidt

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

(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.

About the author: Stephan Schmidt is currently a team manager at ImmobilienScout24 in Berlin. Stephan has been working as a head of development and CTO. He has used a lot of different technologies in the last 20 years including Java, Rails and Python. Stephans main field of interest is maintainablity and productivity in software development. Want to know more? All views are only his own.

If you did like this article but you don't want to subscribe to new articles with your reader, you can follow me on Twitter or subscribe to new posts with your email:

Leave a Reply