1 package com.puppycrawl.tools.checkstyle.checks.suppresswarningsholder; 2 3 public class InputSuppressWarningsHolder2 4 { 5 public static class MyResource implements AutoCloseable { 6 @Override 7 public void close() throws Exception { } 8 } 9 10 public static void main(String[] args) throws Exception { 11 try (@SuppressWarnings("all") final MyResource resource = new MyResource()) { } 12 try (@MyAnnotation("all") final MyResource resource = new MyResource()) { } 13 } 14 } 15 @interface MyAnnotation { 16 String[] value(); 17 }