mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8187631: Refactor FileDescriptor close implementation
Reviewed-by: bpb, alanb
This commit is contained in:
parent
8088bd6350
commit
5e55e5e2ee
20 changed files with 184 additions and 305 deletions
|
@ -341,7 +341,7 @@ class FileInputStream extends InputStream
|
|||
|
||||
fd.closeAll(new Closeable() {
|
||||
public void close() throws IOException {
|
||||
close0();
|
||||
fd.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -403,7 +403,6 @@ class FileInputStream extends InputStream
|
|||
|
||||
private static native void initIDs();
|
||||
|
||||
private native void close0() throws IOException;
|
||||
|
||||
static {
|
||||
initIDs();
|
||||
|
|
|
@ -365,7 +365,7 @@ class FileOutputStream extends OutputStream
|
|||
|
||||
fd.closeAll(new Closeable() {
|
||||
public void close() throws IOException {
|
||||
close0();
|
||||
fd.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -458,8 +458,6 @@ class FileOutputStream extends OutputStream
|
|||
}
|
||||
}
|
||||
|
||||
private native void close0() throws IOException;
|
||||
|
||||
private static native void initIDs();
|
||||
|
||||
static {
|
||||
|
|
|
@ -648,7 +648,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
|
|||
|
||||
fd.closeAll(new Closeable() {
|
||||
public void close() throws IOException {
|
||||
close0();
|
||||
fd.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1177,8 +1177,6 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
|
|||
|
||||
private static native void initIDs();
|
||||
|
||||
private native void close0() throws IOException;
|
||||
|
||||
static {
|
||||
initIDs();
|
||||
SharedSecrets.setJavaIORandomAccessFileAccess(new JavaIORandomAccessFileAccess()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue