diff options
| author | Michael McMahon <michaelm@openjdk.org> | 2019-05-02 17:29:10 +0100 |
|---|---|---|
| committer | Michael McMahon <michaelm@openjdk.org> | 2019-05-02 17:29:10 +0100 |
| commit | 70ea5ab6e1caf42293ab337a64973d2987b760b1 (patch) | |
| tree | b2b783e7e716b95ff797c052e85d0a991443f227 /src/java.base/share/classes/java/net/SocketInputStream.java | |
| parent | 5a496e21d5fc906897fe1e2fdcf96bdce67f4c7f (diff) | |
| download | openjdk-70ea5ab6e1caf42293ab337a64973d2987b760b1.tar.gz openjdk-70ea5ab6e1caf42293ab337a64973d2987b760b1.zip | |
8216978: Drop support for pre JDK 1.4 SocketImpl implementations
Reviewed-by: chegar, alanb, dfuchs
Diffstat (limited to 'src/java.base/share/classes/java/net/SocketInputStream.java')
| -rw-r--r-- | src/java.base/share/classes/java/net/SocketInputStream.java | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/java.base/share/classes/java/net/SocketInputStream.java b/src/java.base/share/classes/java/net/SocketInputStream.java index 1a08aa05a01..878583f7a63 100644 --- a/src/java.base/share/classes/java/net/SocketInputStream.java +++ b/src/java.base/share/classes/java/net/SocketInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2019, 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 @@ -48,7 +48,6 @@ class SocketInputStream extends FileInputStream { private boolean eof; private AbstractPlainSocketImpl impl = null; private byte temp[]; - private Socket socket = null; /** * Creates a new SocketInputStream. Can only be called @@ -59,7 +58,6 @@ class SocketInputStream extends FileInputStream { SocketInputStream(AbstractPlainSocketImpl impl) throws IOException { super(impl.getFileDescriptor()); this.impl = impl; - socket = impl.getSocket(); } /** @@ -236,27 +234,16 @@ class SocketInputStream extends FileInputStream { return eof ? 0 : available; } - /** - * Closes the stream. - */ - private boolean closing = false; - public void close() throws IOException { - // Prevent recursion. See BugId 4484411 - if (closing) - return; - closing = true; - if (socket != null) { - if (!socket.isClosed()) - socket.close(); - } else - impl.close(); - closing = false; - } - void setEOF(boolean eof) { this.eof = eof; } + public void close() throws IOException { + // No longer used. Socket.getInputStream returns an + // InputStream which calls Socket.close directly + assert false; + } + /** * Overrides finalize, the fd is closed by the Socket. */ |
