changeset 3190:22391da9418e

8143301: Sjavac does not close file given to --compare-found-sources Summary: File is now closed after use. Reviewed-by: jlahoda, jjg
author alundblad
date Thu, 07 Jan 2016 11:41:50 +0100
parents 70ac078df098
children e9a7033b2546
files src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java	Wed Jan 06 13:31:20 2016 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java	Thu Jan 07 11:41:50 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, 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
@@ -954,8 +954,7 @@
             }
         }
         // Read in the file and create another set of filenames with full paths.
-        try {
-            BufferedReader in = new BufferedReader(new FileReader(makefileSourceList));
+        try(BufferedReader in = new BufferedReader(new FileReader(makefileSourceList))) {
             for (;;) {
                 String l = in.readLine();
                 if (l==null) break;