1 /* 2 * @test /nodynamiccopyright/ 3 * @bug 6911256 6964740 6965277 4 * @author Joseph D. Darcy 5 * @summary Check that -Xlint:arm warnings are generated as expected 6 * @compile/ref=ArmLint.out -Xlint:arm -XDrawDiagnostics ArmLint.java 7 */ 8 9 class ArmLint implements AutoCloseable { 10 public static void main(String... args) { 11 try(ArmLint r1 = new ArmLint(); 12 ArmLint r2 = new ArmLint(); 13 ArmLint r3 = new ArmLint()) { 14 r1.close(); // The resource's close 15 r2.close(42); // *Not* the resource's close 16 // r3 not referenced 17 } 18 } 19 20 /** 21 * The AutoCloseable method of a resource. 22 */ 23 @Override 24 public void close () { 25 return; 26 } 27 28 /** 29 * <em>Not</em> the AutoCloseable method of a resource. 30 */ 31 public void close (int arg) { 32 return; 33 } 34 }