langtools/test/tools/javac/TryWithResources/InterruptedExceptionTest.java
changeset 27319 030080f03e4f
parent 9076 45c73da050e9
child 30730 d3ce7619db2c
equal deleted inserted replaced
27318:4660a5da7d90 27319:030080f03e4f
     1 /*
     1 /*
     2  * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   115 
   115 
   116     public static void main(String... args) throws Exception {
   116     public static void main(String... args) throws Exception {
   117 
   117 
   118         //create default shared JavaCompiler - reused across multiple compilations
   118         //create default shared JavaCompiler - reused across multiple compilations
   119         JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
   119         JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
   120         StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
   120         try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
   121 
   121 
   122         for (XlintOption xlint : XlintOption.values()) {
   122             for (XlintOption xlint : XlintOption.values()) {
   123             for (SuppressLevel suppress_decl : SuppressLevel.values()) {
   123                 for (SuppressLevel suppress_decl : SuppressLevel.values()) {
   124                 for (SuppressLevel suppress_use : SuppressLevel.values()) {
   124                     for (SuppressLevel suppress_use : SuppressLevel.values()) {
   125                     for (ClassKind ck : ClassKind.values()) {
   125                         for (ClassKind ck : ClassKind.values()) {
   126                         for (ExceptionKind ek_decl : ExceptionKind.values()) {
   126                             for (ExceptionKind ek_decl : ExceptionKind.values()) {
   127                             for (ExceptionKind ek_use : ExceptionKind.values()) {
   127                                 for (ExceptionKind ek_use : ExceptionKind.values()) {
   128                                 new InterruptedExceptionTest(xlint, suppress_decl,
   128                                     new InterruptedExceptionTest(xlint, suppress_decl,
   129                                         suppress_use, ck, ek_decl, ek_use).run(comp, fm);
   129                                             suppress_use, ck, ek_decl, ek_use).run(comp, fm);
       
   130                                 }
   130                             }
   131                             }
   131                         }
   132                         }
   132                     }
   133                     }
   133                 }
   134                 }
   134             }
   135             }