Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4333128

ArrayIndexOutOfBoundsException in FrameSetView.getChildRequests()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.3.0
    • client-libs
    • beta2
    • x86
    • windows_nt



      Name: skT45625 Date: 04/25/2000


      C:\>java -version
      java version "1.3.0rc3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc3-Z)
      Java HotSpot(TM) Client VM (build 1.3.0rc3-Z, mixed mode)

      JEDitorPane fails to display a page (www.snapon.com), which is a hierarchy of
      FrameSets, and after attempting to do so, produces many
      IndexOutOfBoundsExceptions, from which the application never recovers. Note: In
      my application code I was able to verify that most, if not all, of the page was
      parsed as I was able to display its structure as a tree, but nothing was ever
      displayed in the JEditorPane. Other pages with FrameSets work fine.


      SOURCE CODE to demonstrate problem:

      public class TestHTMLRead extends javax.swing.JFrame
          implements java.awt.event.ActionListener
      {
      // Using JDK1.3 RC3, I can't display www.snapon.com in a JEditorPane and
      // after attempting to do so, I get many IndexOutOfBoundsExceptions when
      // I move the mouse pointer within the JEditorPane. To demonstrate, run
      // this program, which should display the page, but doesn't. Then select
      // "Reload" button at the bottom of the page. After this, move the mouse
      // pointer in the JEDitorPane window and you should see the exceptions
      // in the console window.
      //

          String url = "http://www.snapon.com";
          javax.swing.JEditorPane editorPane;
          javax.swing.JScrollPane scrollPane;
          javax.swing.JButton reloadButton;

          public TestHTMLRead()
          {
                  editorPane = new javax.swing.JEditorPane();
                  scrollPane = new javax.swing.JScrollPane(editorPane);
                  getContentPane().add(java.awt.BorderLayout.CENTER, scrollPane);

                  reloadButton = new javax.swing.JButton("Reload");
                  reloadButton.addActionListener(this);
                  getContentPane().add(java.awt.BorderLayout.SOUTH, reloadButton);
                  setSize(750, 425);
          }

          public void reloadBrowser()
          {
              try {
                  editorPane.setPage(url);
              } catch (java.io.IOException ex) { ex.printStackTrace(); }
          }

          public void actionPerformed(java.awt.event.ActionEvent event)
          {
              Object source = event.getSource();
              if (source == reloadButton)
              {
                  reloadBrowser();
              }
          }

          public static void main(String[] argv)
          {
              (new TestHTMLRead()).show();
          }
      }

      Tracebacks:

      java.lang.ArrayIndexOutOfBoundsException
              at javax.swing.text.html.FrameSetView.getChildRequests(Unknown Source)
              at javax.swing.text.html.FrameSetView.layoutMajorAxis(Unknown Source)
              at javax.swing.text.BoxView.layout(Unknown Source)
              at javax.swing.text.BoxView.setSize(Unknown Source)
              at javax.swing.text.BoxView.paint(Unknown Source)
              at javax.swing.text.BoxView.paintChild(Unknown Source)
              at javax.swing.text.BoxView.paint(Unknown Source)
              at javax.swing.text.html.BlockView.paint(Unknown Source)
              at javax.swing.text.BoxView.paintChild(Unknown Source)
              at javax.swing.text.BoxView.paint(Unknown Source)
              at javax.swing.text.html.BlockView.paint(Unknown Source)
              at javax.swing.plaf.basic.BasicTextUI$RootView.paint(Unknown Source)
              at javax.swing.plaf.basic.BasicTextUI.paintSafely(Unknown Source)
              at javax.swing.plaf.basic.BasicTextUI.paint(Unknown Source)
              at javax.swing.plaf.basic.BasicTextUI.update(Unknown Source)
              at javax.swing.JComponent.paintComponent(Unknown Source)
              at javax.swing.JComponent.paint(Unknown Source)
              at javax.swing.JComponent.paintChildren(Unknown Source)
              at javax.swing.JComponent.paint(Unknown Source)
              at javax.swing.JViewport.paint(Unknown Source)
              at javax.swing.JComponent.paintChildren(Unknown Source)
              at javax.swing.JComponent.paint(Unknown Source)
              at javax.swing.JComponent.paintChildren(Unknown Source)
              at javax.swing.JComponent.paint(Unknown Source)
              at javax.swing.JComponent.paintChildren(Unknown Source)
              at javax.swing.JSplitPane.paintChildren(Unknown Source)
              at javax.swing.JComponent.paint(Unknown Source)
              at javax.swing.JComponent.paintChildren(Unknown Source)
              at javax.swing.JSplitPane.paintChildren(Unknown Source)
              at javax.swing.JComponent.paint(Unknown Source)
              at javax.swing.JComponent.paintChildren(Unknown Source)
              at javax.swing.JSplitPane.paintChildren(Unknown Source)
              at javax.swing.JComponent.paint(Unknown Source)
              at javax.swing.JComponent.paintChildren(Unknown Source)
              at javax.swing.JComponent.paint(Unknown Source)
              at javax.swing.JComponent.paintChildren(Unknown Source)
              at javax.swing.JComponent.paint(Unknown Source)
              at javax.swing.JComponent.paintChildren(Unknown Source)
              at javax.swing.JComponent.paint(Unknown Source)
              at javax.swing.JLayeredPane.paint(Unknown Source)
              at javax.swing.JComponent.paintChildren(Unknown Source)
              at javax.swing.JComponent.paint(Unknown Source)
              at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
              at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
              at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
              at java.awt.Container.paint(Unknown Source)
              at sun.awt.RepaintArea.paint(Unknown Source)
              at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
              at java.awt.Component.dispatchEventImpl(Unknown Source)
              at java.awt.Container.dispatchEventImpl(Unknown Source)
              at java.awt.Window.dispatchEventImpl(Unknown Source)
              at java.awt.Component.dispatchEvent(Unknown Source)
              at java.awt.EventQueue.dispatchEvent(Unknown Source)
              at java.awt.EventDispatchThread.pumpOneEvent(Unknown Source)
              at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
              at java.awt.EventDispatchThread.run(Unknown Source)

      This was followed by:

      java.lang.ArrayIndexOutOfBoundsException
              at javax.swing.text.CompositeView.getView(Unknown Source)
              at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.calculateViewPositio
      n(Unknown Source)
              at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.layoutContainer(Unkn
      own Source)
              at java.awt.Container.layout(Unknown Source)
              at java.awt.Container.doLayout(Unknown Source)
              at java.awt.Container.validateTree(Unknown Source)
              at java.awt.Container.validate(Unknown Source)
              at mergent.html.iExtract.mouseEntered(iExtract.java:4559)
              at java.awt.AWTEventMulticaster.mouseEntered(Unknown Source)
              at java.awt.Component.processMouseEvent(Unknown Source)
              at java.awt.Component.processEvent(Unknown Source)
              at java.awt.Container.processEvent(Unknown Source)
              at java.awt.Component.dispatchEventImpl(Unknown Source)
              at java.awt.Container.dispatchEventImpl(Unknown Source)
              at java.awt.Component.dispatchEvent(Unknown Source)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
              at java.awt.LightweightDispatcher.trackMouseEnterExit(Unknown Source)
              at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
              at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
              at java.awt.Container.dispatchEventImpl(Unknown Source)
              at java.awt.Window.dispatchEventImpl(Unknown Source)
              at java.awt.Component.dispatchEvent(Unknown Source)
              at java.awt.EventQueue.dispatchEvent(Unknown Source)
              at java.awt.EventDispatchThread.pumpOneEvent(Unknown Source)
              at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
              at java.awt.EventDispatchThread.run(Unknown Source)
      (Review ID: 104107)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: