-
Bug
-
Resolution: Duplicate
-
P4
-
5.0, 8, 11, 13, 14, 15
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The ImageIcon does not reassert the interrupt status of the current thread. If the interrupt signal is used to cancel a task that displays a message dialog, the ImageIcon will lose that signal.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The interrupt status of the current thread should return true. Then the caller would know if the action was canceled.
ACTUAL -
INTERRUPTED while loading Image
false
ERROR MESSAGES/STACK TRACES THAT OCCUR :
INTERRUPTED while loading Image
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class IconTest implements Runnable {
public IconTest() {
}
public void run() {
Thread.currentThread().interrupt(); //simulate user requested cancel.
JOptionPane.showMessageDialog(null, "");
/*ImageIcon i = new ImageIcon("http://java.sun.com/im/mh_thumb_jgosling.jpg");*/
System.out.println(Thread.interrupted());
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new IconTest());
}
}
---------- END SOURCE ----------
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The ImageIcon does not reassert the interrupt status of the current thread. If the interrupt signal is used to cancel a task that displays a message dialog, the ImageIcon will lose that signal.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The interrupt status of the current thread should return true. Then the caller would know if the action was canceled.
ACTUAL -
INTERRUPTED while loading Image
false
ERROR MESSAGES/STACK TRACES THAT OCCUR :
INTERRUPTED while loading Image
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class IconTest implements Runnable {
public IconTest() {
}
public void run() {
Thread.currentThread().interrupt(); //simulate user requested cancel.
JOptionPane.showMessageDialog(null, "");
/*ImageIcon i = new ImageIcon("http://java.sun.com/im/mh_thumb_jgosling.jpg");*/
System.out.println(Thread.interrupted());
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new IconTest());
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-8236987 Remove call to System.out.println from ImageIcon.loadImage
-
- Resolved
-