<div dir="auto">I was once again writing closing heavy code in a java method and was wondering if I could reduce the clutter of the multi line try block:<div dir="auto">try (var foo1 = new Foo1() ;</div><div dir="auto"><span style="white-space:pre"> </span>var foo2 = new Foo2() ;</div><div dir="auto"><span style="white-space:pre">  </span>....) {</div><div dir="auto">... </div><div dir="auto">}</div><div dir="auto">Sometimes we need to initialize something between the resources and we get multiple levels of nesting. </div><div dir="auto">And I was wondering if we could not just lose the block and auto close at the end of a method like this :</div><div dir="auto"><br></div><div dir="auto">void foo() {</div><div dir="auto"><span style="white-space:pre">     </span>try (var foo1 = new Foo1());</div><div dir="auto"><span style="white-space:pre">     </span>//init some stuff </div><div dir="auto"><span style="white-space:pre">      </span>try (var foo2 = new Foo2());</div><div dir="auto"><span style="white-space:pre">     </span>// do some stuff</div><div dir="auto"><span style="white-space:pre"> </span>// auto close at end of method </div><div dir="auto">}</div><div dir="auto"><br></div><div dir="auto">I think method level try recourse would improve readability and unnecessary nesting significantly.</div></div>