- public Template loadTemplate(String path) {
- InputStream templateInputStream = null;
- Reader reader = null;
- try {
- templateInputStream = getClass().getResourceAsStream(path);
- reader = new InputStreamReader(templateInputStream, "UTF-8");
+ public Template loadTemplate(@Nonnull String path) {
+ try (InputStream templateInputStream = getClass().getResourceAsStream(path);
+ Reader reader = new InputStreamReader(templateInputStream, "UTF-8");) {