6995769: occasion NPE thrown from SwingUtilities.computeIntersection()
authorrupashka
Thu, 28 Jul 2011 18:13:17 +0400
changeset 10103 18425b919fcd
parent 10100 c525c5fbb86c
child 10104 c3cf1968e244
6995769: occasion NPE thrown from SwingUtilities.computeIntersection() Reviewed-by: alexp
jdk/src/share/classes/javax/swing/RepaintManager.java
--- a/jdk/src/share/classes/javax/swing/RepaintManager.java	Mon Jul 18 18:21:31 2011 +0400
+++ b/jdk/src/share/classes/javax/swing/RepaintManager.java	Thu Jul 28 18:13:17 2011 +0400
@@ -758,6 +758,11 @@
             for(i=0 ; i < count ; i++) {
                 dirtyComponent = roots.get(i);
                 rect = tmpDirtyComponents.get(dirtyComponent);
+                // Sometimes when RepaintManager is changed during the painting
+                // we may get null here, see #6995769 for details
+                if (rect == null) {
+                    continue;
+                }
                 localBoundsH = dirtyComponent.getHeight();
                 localBoundsW = dirtyComponent.getWidth();