608N/A/*
608N/A * @test /nodynamiccopyright/
608N/A * @bug 6911256 6964740 6965277
608N/A * @author Maurizio Cimadamore
608N/A * @summary Check that resource variable is not accessible from catch/finally clause
608N/A * @compile/fail/ref=DuplicateResourceDecl.out -XDrawDiagnostics DuplicateResourceDecl.java
608N/A */
608N/A
608N/Aclass DuplicateResourceDecl {
608N/A
608N/A public static void main(String[] args) {
608N/A try(MyResource c = new MyResource();MyResource c = new MyResource()) {
608N/A //do something
608N/A } catch (Exception e) { }
608N/A }
608N/A
608N/A static class MyResource implements AutoCloseable {
608N/A public void close() throws Exception {}
608N/A }
608N/A}