Bug 1769

Summary: Hit count watchpoints not always re-enabled (1GLE911)
Product: [Eclipse Project] JDT Reporter: Joe Szurszewski <eclipse>
Component: DebugAssignee: Joe Szurszewski <eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P1    
Version: 2.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Joe Szurszewski CLA 2001-10-10 22:19:01 EDT
JGS (10/10/01 1:46:12 PM)
	Under 203:

public class InfiniteLoop {

	private String string = "foo";
	protected int counter = 0;

     public static void main(String[] args) {
         (new InfiniteLoop()).loop();
     }

     public void loop() {
         int i = 0;
         while (true) {
              System.out.println("Looping " + i + string);
              i++;
              counter++;
              try {
                  Thread.sleep(1000);
              } catch (InterruptedException e) {
              }
         }
     }
}

	-	Set access watchpoint on 'string', modification watchpoint on 'counter'.
	-	Set hit counts on both watchpoints to 2.
	-	Debug
	-	Both watchpoints are hit
	-	After second watchpoint is hit, set hit count on both to 0
	-	Resume.  Notice how only access watchpoint on 'string' is ever
		hit, the modification watchpoint on 'counter' is ignored.
Comment 1 Darin Wright CLA 2001-10-15 11:50:11 EDT
Please investigate.
Comment 2 Jared Burns CLA 2001-10-17 15:23:01 EDT
Please verify.
Comment 3 Jared Burns CLA 2001-10-17 15:27:45 EDT
Oops.
Comment 4 Jared Burns CLA 2001-10-18 16:11:00 EDT
The problem was a ConcurrentModificationException that was coming out of
JavaBreakpoint#changeForTarget. The method was getting a List of requests,
iterating over that List, and updating the requests as necessary. The trouble
was that "updating" often meant replacing the request (removing it from the List
and adding a new request).
When iteration over the list tried to continue (after modifying the list), we
were getting the exception.
Comment 5 Jared Burns CLA 2001-10-18 16:11:43 EDT
Fixed. JavaBreakpoint#changeForTarget now iterates over a clone of the list.
Comment 6 Joe Szurszewski CLA 2001-10-24 19:16:16 EDT
Verified.