--- old/src/share/classes/java/awt/Component.java 2009-07-15 18:55:22.000000000 +0400 +++ new/src/share/classes/java/awt/Component.java 2009-07-15 18:55:21.000000000 +0400 @@ -872,6 +872,9 @@ public void setAppContext(Component comp, AppContext appContext) { comp.appContext = appContext; } + public void invalidateImpl(Component comp) { + comp.invalidateImpl(); + } }); } @@ -2746,26 +2749,37 @@ */ public void invalidate() { synchronized (getTreeLock()) { - /* Nullify cached layout and size information. - * For efficiency, propagate invalidate() upwards only if - * some other component hasn't already done so first. - */ - valid = false; - if (!isPreferredSizeSet()) { - prefSize = null; - } - if (!isMinimumSizeSet()) { - minSize = null; - } - if (!isMaximumSizeSet()) { - maxSize = null; - } + invalidateImpl(); if (parent != null) { parent.invalidateIfValid(); } } } + /** + * Invalidates this component only, w/o propagating to ancestors. + * + * MUST BE invoked while holding the TreeLock! + */ + void invalidateImpl() { + checkTreeLock(); + + /* Nullify cached layout and size information. + * For efficiency, propagate invalidate() upwards only if + * some other component hasn't already done so first. + */ + valid = false; + if (!isPreferredSizeSet()) { + prefSize = null; + } + if (!isMinimumSizeSet()) { + minSize = null; + } + if (!isMaximumSizeSet()) { + maxSize = null; + } + } + /** Invalidates the component unless it is already invalid. */ final void invalidateIfValid() {