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

JEditorPane.setPage not thread-safe, pageLoader not cancelled

XMLWordPrintable

    • b27
    • 7

      JEditorPane.setPage(URL) loads the provided URL asynchronously.

      The old pageLoader is not cancelled when the new stream is opened synchronously (p < 0). In this case, a synchronized block is used to assign the new value to pageLoader.

      In the asynchronous case (p >= 0), the pageLoader.cancel is called but no synchronization is used, pageLoader could become null right after the code entered the corresponding if-block.

      The new value is assigned to pageLoader without synchronization.

            rkannathpari Renjith Kannath Pariyangad
            aivanov Alexey Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: