I was reading the proposed implementation of Lambda Expressions in Java 7, and I came across some syntax I couldn't understand, and couldn't find out in Google what it meant:
Code:
<T, throws E extends Exception>
in (ignore the closure):
Code:
public static <T, throws E extends Exception>
T withLock(Lock lock, #T()throws E block) throws E {
lock.lock();
try {
return block.invoke();
} finally {
lock.unlock();
}
}
What is "<T, throws E extends Exception>" supposed to mean? Is it part of the implementation of Lambda Expressions?
EDIT:
It goes on to say that this is a valid example of usage of explicit Exceptions using this (again, ignore the closure):
Code:
Locks.<throws IOException|NumberFormatException>withLock(lock, #(){
System.out.println("hello");
});