changeset 4405:34fdcdb70d20

6995769: occasion NPE thrown from SwingUtilities.computeIntersection() Reviewed-by: alexp
author rupashka
date Thu, 28 Jul 2011 18:13:17 +0400
parents c05b36e4749e
children 86098b3f7789
files src/share/classes/javax/swing/RepaintManager.java
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/swing/RepaintManager.java	Mon Jul 18 18:21:31 2011 +0400
+++ b/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();