added code from http://matcherror.blogspot.nl/2013/08/implementing-try-with-resources-in-xtend.html