2 ms·
I've taken Groovy's with... syntax and built utils that are ie: public void withConnection(Callback<Connection> callback) { Connection connection = createCon
by reverend_gonzo 15y ago
I've taken Groovy's with... syntax and built utils that are ie:
public void withConnection(Callback<Connection> callback) {
Connection connection = createConnection();
try {
callback.call(connection);
} finally {
connection.dispose();
}
}
Once Java actually gets closures it'll make this soooo much nicer.