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

Bad behavior for JDB on program that works fine without JDB

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.1.1
    • core-svc
    • None
    • x86
    • windows_nt



      Name: sg39081 Date: 06/30/97


      The program at the bottom of this message works fine when run
      outside the debugger but gets the following non-recoverable error
      when run within the JDK 1.1.1 version of JDB:

      E:\INTRASPECT>e:\jdk1.1.1\bin\jdb
      Initializing jdb...
      > run awttest
      running ...
      main[1]
      Uncaught exception: java.lang.ArrayIndexOutOfBoundsException -1 < 0
      at java.util.Vector.elementAt(Vector.java:326)
      at java.awt.List.getItem(List.java:142)
      at sun.awt.windows.WToolkit.run(WToolkit.java:103)
      at java.lang.Thread.run(Thread.java:474)

      AWT-Windows[1]

      --------------------------
      import java.awt.*;

      public class awttest extends Frame {

        Menu servermenu;
        MenuItem exitServer;

        List connection_list;

        public static void main (String args[]) {
          awttest mytest = new awttest ();
          mytest.doit ();
        }

        void doit () {

          connection_list = new List();
          add("Center", connection_list);

          resize(new Dimension(400,200));
          show();

          MenuBar mb = new MenuBar();
          servermenu = new Menu("Server");
          servermenu.add(exitServer = new MenuItem("Exit"));
          mb.add(servermenu);

          setMenuBar(mb);
        }

        public boolean handleEvent(Event event) {
          switch(event.id) {
          case Event.WINDOW_DESTROY:
            System.out.println("Window Destroy called");
            Runtime.getRuntime().exit(0);
            return true;
          }
          return super.handleEvent(event);
        }
        public boolean action(Event event, Object arg) {
          if (event.target instanceof MenuItem) {
            String label = (String) arg;
            if (event.target == exitServer) {
              Runtime.getRuntime().exit(0);
              return true;
            }
          }
          return super.action(event, arg);
        }
      }

      company - Intraspect Software , email - ###@###.###
      ======================================================================

            rfield Robert Field (Inactive)
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: