On Thu, 10 Mar 2022 13:19:22 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> src/java.desktop/share/classes/javax/swing/ImageIcon.java line 331: >> >>> 329: mTracker.waitForID(id, 0); >>> 330: } catch (InterruptedException e) { >>> 331: System.out.println("INTERRUPTED while loading Image"); >> >> should be ok. Only question is, should we set the Thread interrupt flag or >> MediaTracker ABORTED flag too here but seems like this file does not check >> for error status after calling loadImage and it's been there for long so it >> might affect existing application using ImageIcon. > > That was my concern too. In fact, `InterruptedException` is not in the > regular flow, it indicates a somewhat error condition which isn't actually > handled. > > If `loadStatus` of the image is not `COMPLETE` or `ERRORED`, we should > probably move it to `ABORTED`. > > I don't think we should raise Thread.interrupt flag again. WaitForID() definition states that "If there is an error while loading or scaling an image, then that image is considered to have finished loading". Does this indicates that no error checking is required.....? ------------- PR: https://git.openjdk.java.net/jdk/pull/7754