提交 86c5b5ee 编写于 作者: D dcherepanov

6612497: api/java_awt/Container/index.html#isAncestorOf Container2019 hangs since JDK 7 b15

Summary: Partial rollback changes for 6567564 in the Component.getGC method
Reviewed-by: art, son
上级 14072039
...@@ -935,24 +935,26 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -935,24 +935,26 @@ public abstract class Component implements ImageObserver, MenuContainer,
*/ */
public GraphicsConfiguration getGraphicsConfiguration() { public GraphicsConfiguration getGraphicsConfiguration() {
synchronized(getTreeLock()) { synchronized(getTreeLock()) {
GraphicsConfiguration gc = graphicsConfig; if (graphicsConfig != null) {
Component parent = getParent(); return graphicsConfig;
while ((gc == null) && (parent != null)) { } else if (getParent() != null) {
gc = parent.getGraphicsConfiguration(); return getParent().getGraphicsConfiguration();
parent = parent.getParent(); } else {
return null;
} }
return gc;
} }
} }
final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() { final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() {
GraphicsConfiguration gc = this.graphicsConfig; GraphicsConfiguration graphicsConfig = this.graphicsConfig;
Component par = this.parent; Container parent = this.parent;
while ((gc == null) && (par != null)) { if (graphicsConfig != null) {
gc = par.getGraphicsConfiguration_NoClientCode(); return graphicsConfig;
par = par.parent; } else if (parent != null) {
return parent.getGraphicsConfiguration_NoClientCode();
} else {
return null;
} }
return gc;
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册