langtools/test/tools/javac/7079713/TestCircularClassfile.java
changeset 27319 030080f03e4f
parent 10456 22e3243c8a81
child 30730 d3ce7619db2c
--- a/langtools/test/tools/javac/7079713/TestCircularClassfile.java	Wed Oct 29 12:09:17 2014 +0100
+++ b/langtools/test/tools/javac/7079713/TestCircularClassfile.java	Wed Oct 29 17:25:23 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -100,13 +100,14 @@
 
     public static void main(String... args) throws Exception {
         JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
-        StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
-        int count = 0;
-        for (SourceKind sk1 : SourceKind.values()) {
-            for (SourceKind sk2 : SourceKind.values()) {
-                for (TestKind tk : TestKind.values()) {
-                    for (ClientKind ck : ClientKind.values()) {
-                        new TestCircularClassfile("sub_"+count++, sk1, sk2, tk, ck).check(comp, fm);
+        try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
+            int count = 0;
+            for (SourceKind sk1 : SourceKind.values()) {
+                for (SourceKind sk2 : SourceKind.values()) {
+                    for (TestKind tk : TestKind.values()) {
+                        for (ClientKind ck : ClientKind.values()) {
+                            new TestCircularClassfile("sub_"+count++, sk1, sk2, tk, ck).check(comp, fm);
+                        }
                     }
                 }
             }