From d3c8596f9912e48ba120840da0e44da99a9268cd Mon Sep 17 00:00:00 2001 From: "nboyd%atg.com" Date: Fri, 1 Feb 2008 15:11:59 +0000 Subject: [PATCH] Fix bug 414869: Rhino debugger fails to launch due to updates in mac os x leopard git-svn-id: svn://10.0.0.236/trunk@244661 18797224-902f-48f8-a5cc-f745e15eee43 --- .../mozilla/javascript/tools/debugger/SwingGui.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java index ac40d831e9a..61dc065f897 100644 --- a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java +++ b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java @@ -2178,8 +2178,15 @@ class FileWindow extends JInternalFrame implements ActionListener { * Updates the tool tip contents. */ private void updateToolTip() { - // in case fileName is very long, try to set tool tip on frame - Component c = getComponent(1); + // Try to set tool tip on frame. On Mac OS X 10.5, + // the number of components is different, so try to be safe. + int n = getComponentCount() - 1; + if (n > 1) { + n = 1; + } else if (n < 0) { + return; + } + Component c = getComponent(n); // this will work at least for Metal L&F if (c != null && c instanceof JComponent) { ((JComponent)c).setToolTipText(getUrl()); @@ -2606,7 +2613,7 @@ class VariableModel implements TreeTableModel { Object value = getValue(node); Object[] ids = debugger.getObjectIds(value); - if (ids.length == 0) { + if (ids == null || ids.length == 0) { children = CHILDLESS; } else { Arrays.sort(ids, new Comparator() {