I have come across a piece of code that looks like this
try
{
try (SomeResource res = new SomeResource())
{
// "\(o.o)/" *BOO*
}
}
catch (SomeException e)
{
e.letsNotIgnoreTheException();
}
I could not think of a single reason to use two try-blocks. No one else I asked could think of one either.
I am left to wonder, whether this is simply a methode in need of some refactoring, or if there actually is some use to the outer try (especially since I found this several times, but then again, someone might have simply misunderstood the try-with-resources).