Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8365197

javax.imageio.stream MemoryCache based streams no longer need a disposer.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • 26
    • client-libs
    • None

      https://bugs.openjdk.org/browse/JDK-8277585 will remove the finalization support from javax.imageio.stream classes.

      javax.imageio.stream.MemoryCacheImageInputStream does not actually use finalization - it uses a disposer / cleaner.
      But all that does is clear a memory cache which is an ArrayList of byte[]
      I don't see why that needs disposing.

      So we can just get rid of it.

      javax.imageio.stream.MemoryCacheImageOutputStream does use finalize() but that's because in close() it wants to flush() the stream as well.

      However after JDK-8277585 when finalize is no longer used, it will be in the same situation as the input stream.

      I think we can just get rid of dispose for both of these - and in fact I didn't add a disposer to MemoryCacheImageOutputStream so that part is already done !
       

            prr Philip Race
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: