1   //non-compiled with javac: Compilable with Java9
2   package com.puppycrawl.tools.checkstyle.grammar.java9;
3   
4   /**
5    * Input for Java 9 try-with-resources.
6    */
7   public class InputJava9TryWithResources
8   {
9       public static class MyResource implements AutoCloseable {
10          @Override
11          public void close() throws Exception { }
12      }
13  
14      public static void main(String[] args) throws Exception {
15          MyResource resource = new MyResource();
16          try (resource) { } finally { }
17  
18          final MyResource resource1 = new MyResource();
19          final MyResource resource2 = new MyResource();
20          try (resource1;resource2) { } finally { }
21      }
22  }