Eclipse supports try-with-resource, somewhat like this:
try(Outputstream resource = new FileOutputStream(file)){
// do something...
}
It has been years since this featured added to eclipse, but there is no template "try-with-reousource". only exists one is "try-catch".
I tried to make template, like try($type{} ${localVar} = new $type{}){ {$cursor{} }
, but was useless. (non-AutoClosable types were also suggested)
Is there any useful try-with-resource template?
There's no "try-with-resource" template included in Eclipse.
There is an open issue for it: Bug 351864 - [1.7][templates] Add 'try-with-resource' template
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With