UnusedResourcesTest.java revision 904
661N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 661N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 661N/A * under the terms of the GNU General Public License version 2 only, as 661N/A * published by the Free Software Foundation. 661N/A * This code is distributed in the hope that it will be useful, but WITHOUT 661N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 661N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 661N/A * version 2 for more details (a copy is included in the LICENSE file that 661N/A * accompanied this code). 661N/A * You should have received a copy of the GNU General Public License version 661N/A * 2 along with this work; if not, write to the Free Software Foundation, 661N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 661N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 661N/A * or visit www.oracle.com if you need additional information or have any 0N/A * @summary False positive for -Xlint:try with nested try with resources blocks 0N/A "@SuppressWarnings(\"try\")" :
"public void close() {}\n" +
"void use(Resource r) {}\n" +
"try (Resource #R1 = new Resource()) {\n" +
"try (Resource #R2 = new Resource()) {\n" +
"try (Resource #R3 = new Resource()) {\n" +
// Create a single file manager and reuse it for each compile to save time. throw new Error(
"invalid diagnostics for source:\n" +