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

Restore interrupted flag in ImageIcon.loadImage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 19
    • client-libs
    • b19
    • 19
    • b06

      ImageIcon.loadImage used to handle InterruptedException only by printing a message to the console, JDK-8236987 handled the interrupted state more gracefully, but it didn't restore the interrupted flag.

      Restoring the interrupted flag will allow the following code to handle interruption and exit the thread; otherwise, the thread will continue to run.

      * “General-purpose task and library code should never swallow interruption requests.” — Java Concurrency in Practice, by Brian Goetz, Chapter 7. Cancellation and Shutdown, section 7.1.3 Responding to interruption.

            rmahajan Rajat Mahajan
            aivanov Alexey Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: