1 /* |
1 /* |
2 * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
411 |
411 |
412 /** |
412 /** |
413 * Ensures that the <code>close</code> method of this file input stream is |
413 * Ensures that the <code>close</code> method of this file input stream is |
414 * called when there are no more references to it. |
414 * called when there are no more references to it. |
415 * |
415 * |
|
416 * @deprecated The {@code finalize} method has been deprecated. |
|
417 * Subclasses that override {@code finalize} in order to perform cleanup |
|
418 * should be modified to use alternative cleanup mechanisms and |
|
419 * to remove the overriding {@code finalize} method. |
|
420 * When overriding the {@code finalize} method, its implementation must explicitly |
|
421 * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. |
|
422 * See the specification for {@link Object#finalize()} for further |
|
423 * information about migration options. |
|
424 * |
416 * @exception IOException if an I/O error occurs. |
425 * @exception IOException if an I/O error occurs. |
417 * @see java.io.FileInputStream#close() |
426 * @see java.io.FileInputStream#close() |
418 */ |
427 */ |
|
428 @Deprecated(since="9") |
419 protected void finalize() throws IOException { |
429 protected void finalize() throws IOException { |
420 if ((fd != null) && (fd != FileDescriptor.in)) { |
430 if ((fd != null) && (fd != FileDescriptor.in)) { |
421 /* if fd is shared, the references in FileDescriptor |
431 /* if fd is shared, the references in FileDescriptor |
422 * will ensure that finalizer is only called when |
432 * will ensure that finalizer is only called when |
423 * safe to do so. All references using the fd have |
433 * safe to do so. All references using the fd have |