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

breakpoint on Thread.sleep() vaporizers after initial execution

XMLWordPrintable

    • rc1
    • sparc
    • solaris_7
    • Not verified



        Name: md23716 Date: 01/21/2001

             UNEXPECTED BEHAVIOUR

             Test case:

             --------------------------------------------------------------------
             01 import java.lang.*;
             02 import java.util.*;
             03
             04 public class InfiniteLoop
             05 {
             06 InfiniteLoop()
             07 {
             08 }
             09
             10 public static void main(String args[])
             11 {
             12 (new InfiniteLoop()).run();
             13 }
             14
             15 public void run()
             16 {
             17 System.out.println("In InfiniteLoop.run()");
             18
             19 boolean i = true;
             20 int j = 0;
             21 while(i)
             22 {
             23 System.out.println("j = " + (j++));
             24 try
             25 {
             26 Thread.sleep(500);
             27 }
             28 catch (Exception excp)
             29 {
             30 }
             31 }
             32 }
             33 }
             --------------------------------------------------------------------

             1. Start jdb (which uses the new JPDA) on InfiniteLoop:

                  jdb InfiniteLoop

             2. Set breakpoints at lines 23 and 26:

                  stop at InfiniteLoop:23
                  stop at InfiniteLoop:26

             3. Run

                  run

             4. Continue several times, note that after stopping on
                line 26 the first time, jdb never stops there again:

                  cont
                  ...

             5. Try to do some step overs - note that jdb only steps
                on line 23 and not the other executable lines:

                  next
                  ...

             Note that if the test case is started again and instead
             of setting the above breakpoints you break at line 17 and
             start stepping over from there, jdb will work properly
             and will stop on each executable line in the loop.

        4. Targeted FCS Release

             SOLARIS JDK 1.3.1





        ======================================================================

              mchung Mandy Chung (Inactive)
              mdevereuorcl Michelle Devereux (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: