Macs, Java, software development, IT related books and things I do for a living.
Archive for August, 2009
Silverlight 3.0.40723.0 crashes Safari under Snow leopard
Aug 31st
This is the first big issue i’ve seen with Snow Leopard so far.
Nothing to bad for me for now, but I discovered this while loading the intranet site at my work. The welcome page contains a Silverlight applet. Removing Silverlight from my internet pluging folder resolved the issue.
I’m guessing Microsoft will have a solution for this pretty soon.
JDK 7 – Project Coin is final
Aug 29th
Friday Joseph Darcy announced through a blog post that Project Coin is final.
Project Coin is just one of the changes coming to JDK 7. But, since the changes in Project Coin are all small changes to the Java language, every single Java developer will have to deal with these coming changes.
- It’s looking like we can use Strings in switch statements:
static boolean booleanFromString(String s) { switch(s) { case "true": return true; case "false": return false; } throw new IllegalArgumentException(s); } - Automated Resource Blocks, Josh Bloch proposed a construct like the one below:
try (BufferedReader br = new BufferedReader(new FileReader(path)) { return br.readLine(); }instead of:
BufferedReader br = new BufferedReader(new FileReader(path)); try { return br.readLine(); } finally { br.close(); } -
Improved Type Inference, the diamond operator. Instead of:
Map <String, List <String> anagrams = new HashMap <String, List <String>();
you can do:
Map <String, List <String> anagrams = new HashMap <>();
- Simplified VARARG method invocation:
static <T> List <T> asList(T... elements) { ... } static List <Callable <String> stringFactories() { Callable <String> a, b, c; ... *// Warning: ** uses unchecked or unsafe operations * return asList(a, b, c); }After this change:
*// Warning: ** enables unsafe generic array creation * static <T> List <T> asList(T... elements) { ... } static List <Callable <String> stringFactories() { Callable <String> a, b, c; ... return asList(a, b, c); } - Something with better literal integers, can’t seem to find the details at the moment.
- And language support for JSR 292. But this one is only interesting when dealing with dynamic languages.