mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8302685: Some javac unit tests aren't reliably closing open files
Reviewed-by: darcy, vromero
This commit is contained in:
parent
f5a12768fb
commit
55e6bb6b85
58 changed files with 240 additions and 391 deletions
|
@ -42,6 +42,7 @@ import combo.ComboInstance;
|
|||
import combo.ComboParameter;
|
||||
import combo.ComboTask;
|
||||
import combo.ComboTestHelper;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Iterator;
|
||||
|
@ -110,7 +111,10 @@ public class ConditionalExpressionResolvePending extends ComboInstance<Condition
|
|||
if (filesIt.hasNext()) {
|
||||
throw new IllegalStateException("More than one classfile returned!");
|
||||
}
|
||||
byte[] data = file.openInputStream().readAllBytes();
|
||||
byte[] data;
|
||||
try (InputStream input = file.openInputStream()) {
|
||||
data = input.readAllBytes();
|
||||
}
|
||||
ClassLoader inMemoryLoader = new ClassLoader() {
|
||||
protected Class<?> findClass(String name) throws ClassNotFoundException {
|
||||
if ("Test".equals(name)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue