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

TTY: JDI fires invalid StepEvent while stepping through if statements

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • 1.4.2
    • core-svc
    • x86
    • windows_2000

    Description



      Name: rmT116609 Date: 07/22/2004


      FULL PRODUCT VERSION :
      java version "1.4.2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
      Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

      FULL OS VERSION :
      Windows 2000 and Windows XP Professional

      A DESCRIPTION OF THE PROBLEM :
      Sometimes JDI fires invalid StepEvent while stepping through if statements
      Actually JDI only reports the ivalid StepEvent but do not execute the line.

      This bug is reproduced either with jdb or Intellij IDEA debugger. Either with javac or jikes.

      If there are several statements in the if statement body JDI fires invalid StepEvent that is connected to the last line of the if statement body.

      I make stepOver by creating
      requestManager.createStepRequest(thread, StepRequest.STEP_LINE, StepRequest.STEP_OVER);
      and resuming VM.

      You can see thread in the forum for more info
      http://www.intellij.net/tracker/idea/viewSCR?publicId=14986

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Step over if(b2){...} JDI fires StepEvent at the System.out inside the if statement.

      package debug;
      public class Test{
         public static void main(String[] args) {
            boolean b1 = true;
            if (b1) {
               boolean b2 = false;
               if (b2) {
                 System.out.println("should not be reached1");
               }
            }
            else {
               System.out.println("should not be reached2");
            }
         }
      }


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      JDI should fire StepEvent that is connected to the end of the method.

      ACTUAL -
      JDI fires StepEvent at the System.out.println("should not be reached1");
       


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      There were no messages.

      REPRODUCIBILITY :
      This bug can be reproduced always.
      (Incident Review ID: 199555)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              tbell Tim Bell
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: