< prev index next >

src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java

Print this page

851      */
852     public boolean isCachedFile() {
853         return false;
854     }
855 
856     public void close() throws IOException {
857         checkClosed();
858 
859         isClosed = true;
860     }
861 
862     /**
863      * Finalizes this object prior to garbage collection.  The
864      * {@code close} method is called to close any open input
865      * source.  This method should not be called from application
866      * code.
867      *
868      * @exception Throwable if an error occurs during superclass
869      * finalization.
870      *
871      * @deprecated The {@code finalize} method has been deprecated.
872      *     Subclasses that override {@code finalize} in order to perform cleanup
873      *     should be modified to use alternative cleanup mechanisms and
874      *     to remove the overriding {@code finalize} method.
875      *     When overriding the {@code finalize} method, its implementation must explicitly
876      *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
877      *     See the specification for {@link Object#finalize()} for further
878      *     information about migration options.
879      */
880     @Deprecated(since="9")

881     protected void finalize() throws Throwable {
882         if (!isClosed) {
883             try {
884                 close();
885             } catch (IOException e) {
886             }
887         }
888         super.finalize();
889     }
890 }

851      */
852     public boolean isCachedFile() {
853         return false;
854     }
855 
856     public void close() throws IOException {
857         checkClosed();
858 
859         isClosed = true;
860     }
861 
862     /**
863      * Finalizes this object prior to garbage collection.  The
864      * {@code close} method is called to close any open input
865      * source.  This method should not be called from application
866      * code.
867      *
868      * @exception Throwable if an error occurs during superclass
869      * finalization.
870      *
871      * @deprecated Finalization has been deprecated for removal.  See
872      * {@link java.lang.Object#finalize} for background information and details
873      * about migration options.





874      */
875     @Deprecated(since="9", forRemoval=true)
876     @SuppressWarnings("removal")
877     protected void finalize() throws Throwable {
878         if (!isClosed) {
879             try {
880                 close();
881             } catch (IOException e) {
882             }
883         }
884         super.finalize();
885     }
886 }
< prev index next >