Thursday, August 18, 2011

Now you can track your stolen laptop / phone (but not iPhone yet) for free using an open source software called Prey. It is a very small & lightweight software that can be installed on your Mac, Windows, Linux or Ubuntu Laptop or your Android smart Phone. Set it up and then you can wake it up in case your device is (God forbid) stolen. There are paid Pro version too for those who want a greater feature set and active monitoring.
This was recently used by self professed Info Sec Evangelist Greg Martin to track his stolen MacBook in the aftermath of the London riots.

This is a short cut to reduce typing and make it simpler to infer generic types during instance creation

Map<String, List<Pair<String,BigDecimal>> myMap = new HashMap<>();

Simplified varargs method invocation

When a programmer tries to invoke a *varargs* (variable arity) method with a non-reifiable varargs type, the compiler currently generates an "unsafe operation" warning. This proposal moves the warning from the call site to the method declaration. This merits more detailed explanation and a separate post.

Multi-catch and more precise throw

Now you can catch multiple exceptions in the same catch clause and also re-throw final exceptions without declaring the method with the "throws" clause. More Precise Rethrow allows you to catch a high level exception instead of each possible exception, but when you re-throw this caught exception, the correct sub-class is thrown instead of the higher level exception. This merits more detailed explanation and a separate post.

Fork & Join threading enhancements
New Fork / Join framework as an implementation of the ExecutorService to help take advantage of mulit-core / multi-processor machines.

NIO 2.0 & File system access enhancements
NIO 2.0 & File system related changes make it easier for traversing file system trees and access file properties.
There are numerous changes and these could be a good candidate for a separate book in itself.

As part of Project Coin - Language enhancements, Java 7 has introduced the Diamond operator "<>".
In reality, this is just a short cut for a simpler type inference for generic instance creation.
So instead of this:

List<String> stringList = new ArrayList>String>();

one can use this in Java7:

List<String> stringList = new ArrayList<>();

So you say "big deal"?! The real benefits show when the type being inferred is very complicated and has multiple types nested in it like:

Map<String, List<Pair<String,BigDecimal>> myMap = new HashMap<>();

You are saved from repeating the same thing - less typing and less errors!