Isn't there a risk that for loop might throw an exception and latch.countDown() will never be called?

It should be in a finally clause.