According to the specs, Graphics.getClip(Bounds) may return null when no
clip is set. I added appropriate checks to the RepaintManager to avoid
NPEs in such situations.

2006-03-03  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/plaf/basic/BasicHTML.java
        (HTMLRootView): New inner class.
        (createHTMLView): Embed view inside a HTMLRootView.

/Roman
Index: javax/swing/RepaintManager.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/RepaintManager.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- javax/swing/RepaintManager.java	27 Feb 2006 12:45:35 -0000	1.27
+++ javax/swing/RepaintManager.java	3 Mar 2006 10:06:10 -0000	1.28
@@ -636,9 +636,10 @@
             Graphics g = root.getGraphics();
             Image buffer = (Image) offscreenBuffers.get(root);
             Rectangle clip = g.getClipBounds();
-            area = SwingUtilities.computeIntersection(clip.x, clip.y,
-                                                      clip.width, clip.height,
-                                                      area);
+            if (clip != null)
+              area = SwingUtilities.computeIntersection(clip.x, clip.y,
+                                                        clip.width, clip.height,
+                                                        area);
             int dx1 = area.x;
             int dy1 = area.y;
             int dx2 = area.x + area.width;

Reply via email to