8157996: Unneeded import in lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java

Reviewed-by: mchung, chegar
This commit is contained in:
Alexandre Iline 2016-05-27 14:26:58 -07:00 committed by Alexandre Iline
parent 6d029e8034
commit 9862c36936

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 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
@ -23,8 +23,6 @@
package jdk.testlibrary;
import com.sun.net.httpserver.*;
import java.util.*;
import java.util.concurrent.*;
import java.io.*;
@ -63,9 +61,11 @@ public class SimpleSSLContext {
try {
File f = new File(path, "jdk/testlibrary/testkeys");
if (f.exists()) {
init (new FileInputStream(f));
try (FileInputStream fis = new FileInputStream(f)) {
init(fis);
return;
}
}
} catch (SecurityException e) {
// catch and ignore because permission only required
// for one entry on path (at most)
@ -82,9 +82,10 @@ public class SimpleSSLContext {
*/
public SimpleSSLContext(String dir) throws IOException {
String file = dir+"/testkeys";
FileInputStream fis = new FileInputStream(file);
try (FileInputStream fis = new FileInputStream(file)) {
init(fis);
}
}
private void init(InputStream i) throws IOException {
try {