-
Bug
-
Resolution: Fixed
-
P4
-
1.4.2_02, 5.0, 6
-
b11
-
generic, x86
-
generic, windows_xp
Name: js151677 Date: 08/02/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
In javax.swing.JComponent
in
void _paintImmediately(int x, int y, int w, int h)
is this:
try {
try {
Graphics pcg = paintingComponent.getGraphics();
g = (pcg == null) ? null : pcg.create();
pcg.dispose();
} catch(NullPointerException e) {
g = null;
e.printStackTrace();
}
If pcg is null, pcg.dispose will still be disposed.
Thus the reason for unneccessary try/catch block
REPRODUCIBILITY :
This bug can be reproduced always.
(Incident Review ID: 290502)
======================================================================
###@###.### 10/14/04 22:25 GMT
FULL PRODUCT VERSION :
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
In javax.swing.JComponent
in
void _paintImmediately(int x, int y, int w, int h)
is this:
try {
try {
Graphics pcg = paintingComponent.getGraphics();
g = (pcg == null) ? null : pcg.create();
pcg.dispose();
} catch(NullPointerException e) {
g = null;
e.printStackTrace();
}
If pcg is null, pcg.dispose will still be disposed.
Thus the reason for unneccessary try/catch block
REPRODUCIBILITY :
This bug can be reproduced always.
(Incident Review ID: 290502)
======================================================================
###@###.### 10/14/04 22:25 GMT
- duplicates
-
JDK-5004059 JComponent.paintImmediately() always prints stack trace for NPE
- Closed