6887249: Get rid of double-check for isValid() idiom in validate() methods
Reviewed-by: art, dcherepanov
This commit is contained in:
parent
4b2a80c711
commit
85e10718ce
@ -1583,8 +1583,6 @@ public class Container extends Component {
|
|||||||
* @see #validateTree
|
* @see #validateTree
|
||||||
*/
|
*/
|
||||||
public void validate() {
|
public void validate() {
|
||||||
/* Avoid grabbing lock unless really necessary. */
|
|
||||||
if (!isValid() || descendUnconditionallyWhenValidating) {
|
|
||||||
boolean updateCur = false;
|
boolean updateCur = false;
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
if ((!isValid() || descendUnconditionallyWhenValidating)
|
if ((!isValid() || descendUnconditionallyWhenValidating)
|
||||||
@ -1612,7 +1610,6 @@ public class Container extends Component {
|
|||||||
updateCursorImmediately();
|
updateCursorImmediately();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether valid containers should also traverse their
|
* Indicates whether valid containers should also traverse their
|
||||||
|
Loading…
x
Reference in New Issue
Block a user