提交 3faf0839 编写于 作者: A alexp

6653511: JComponent.safelyGetGraphics() may sometimes return null

Reviewed-by: rupashka
上级 483b53a0
......@@ -5158,9 +5158,8 @@ public abstract class JComponent extends Container implements Serializable,
}
}
}
try {
g = safelyGetGraphics(paintingComponent, c);
if ((g = safelyGetGraphics(paintingComponent, c)) != null) {
try {
if (hasBuffer) {
RepaintManager rm = RepaintManager.currentManager(
......@@ -5175,16 +5174,16 @@ public abstract class JComponent extends Container implements Serializable,
} finally {
rm.endPaint();
}
}
else {
g.setClip(paintImmediatelyClip.x,paintImmediatelyClip.y,
paintImmediatelyClip.width,paintImmediatelyClip.height);
} else {
g.setClip(paintImmediatelyClip.x, paintImmediatelyClip.y,
paintImmediatelyClip.width, paintImmediatelyClip.height);
paintingComponent.paint(g);
}
} finally {
g.dispose();
}
}
}
finally {
// Reset the painting child for the parent components.
if(paintingComponent != this) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册