# HG changeset patch # User dcherepanov # Date 1205508454 -10800 # Node ID c4ce9d68f58e8405dd9c780c7b494628ec122260 # Parent 35b334a806ab74c4d15980770f179986569ee38f 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 diff -r 35b334a806ab -r c4ce9d68f58e jdk/src/share/classes/java/awt/Component.java --- a/jdk/src/share/classes/java/awt/Component.java Fri Mar 14 17:23:25 2008 +0300 +++ b/jdk/src/share/classes/java/awt/Component.java Fri Mar 14 18:27:34 2008 +0300 @@ -935,24 +935,26 @@ */ public GraphicsConfiguration getGraphicsConfiguration() { synchronized(getTreeLock()) { - GraphicsConfiguration gc = graphicsConfig; - Component parent = getParent(); - while ((gc == null) && (parent != null)) { - gc = parent.getGraphicsConfiguration(); - parent = parent.getParent(); - } - return gc; + if (graphicsConfig != null) { + return graphicsConfig; + } else if (getParent() != null) { + return getParent().getGraphicsConfiguration(); + } else { + return null; + } } } final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() { - GraphicsConfiguration gc = this.graphicsConfig; - Component par = this.parent; - while ((gc == null) && (par != null)) { - gc = par.getGraphicsConfiguration_NoClientCode(); - par = par.parent; - } - return gc; + GraphicsConfiguration graphicsConfig = this.graphicsConfig; + Container parent = this.parent; + if (graphicsConfig != null) { + return graphicsConfig; + } else if (parent != null) { + return parent.getGraphicsConfiguration_NoClientCode(); + } else { + return null; + } } /**