src/java.base/unix/classes/sun/nio/ch/FileKey.java

Print this page
rev 11078 : 8025619: (fc) FileInputStream.getChannel on closed stream returns FileChannel that doesn't know that stream is closed
Summary: If the stream is closed ensure getChannel() returns a closed channel. Also, FileKey.create() should throw an IOException directly instead of wrapping it in an Error.
Reviewed-by: TBD

*** 36,52 **** private long st_dev; // ID of device private long st_ino; // Inode number private FileKey() { } ! public static FileKey create(FileDescriptor fd) { FileKey fk = new FileKey(); - try { fk.init(fd); - } catch (IOException ioe) { - throw new Error(ioe); - } return fk; } public int hashCode() { return (int)(st_dev ^ (st_dev >>> 32)) + --- 36,48 ---- private long st_dev; // ID of device private long st_ino; // Inode number private FileKey() { } ! public static FileKey create(FileDescriptor fd) throws IOException { FileKey fk = new FileKey(); fk.init(fd); return fk; } public int hashCode() { return (int)(st_dev ^ (st_dev >>> 32)) +