8143301: Sjavac does not close file given to --compare-found-sources
Summary: File is now closed after use.
Reviewed-by: jlahoda, jjg
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java Wed Jan 06 13:31:20 2016 -0800
+++ b/langtools/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;