diff --git a/src/share/classes/java/awt/Container.java b/src/share/classes/java/awt/Container.java index 84334c9973e789f639b7f3368e9bb50ae5321333..94273ade4cb74adbbccc24fedbac5a45ab5b3529 100644 --- a/src/share/classes/java/awt/Container.java +++ b/src/share/classes/java/awt/Container.java @@ -1583,34 +1583,31 @@ public class Container extends Component { * @see #validateTree */ public void validate() { - /* Avoid grabbing lock unless really necessary. */ - if (!isValid() || descendUnconditionallyWhenValidating) { - boolean updateCur = false; - synchronized (getTreeLock()) { - if ((!isValid() || descendUnconditionallyWhenValidating) - && peer != null) - { - ContainerPeer p = null; - if (peer instanceof ContainerPeer) { - p = (ContainerPeer) peer; - } - if (p != null) { - p.beginValidate(); - } - validateTree(); - if (p != null) { - p.endValidate(); - // Avoid updating cursor if this is an internal call. - // See validateUnconditionally() for details. - if (!descendUnconditionallyWhenValidating) { - updateCur = isVisible(); - } + boolean updateCur = false; + synchronized (getTreeLock()) { + if ((!isValid() || descendUnconditionallyWhenValidating) + && peer != null) + { + ContainerPeer p = null; + if (peer instanceof ContainerPeer) { + p = (ContainerPeer) peer; + } + if (p != null) { + p.beginValidate(); + } + validateTree(); + if (p != null) { + p.endValidate(); + // Avoid updating cursor if this is an internal call. + // See validateUnconditionally() for details. + if (!descendUnconditionallyWhenValidating) { + updateCur = isVisible(); } } } - if (updateCur) { - updateCursorImmediately(); - } + } + if (updateCur) { + updateCursorImmediately(); } }