Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 37760

Summary: Registering an IJavaBreakpointListener causes breakpoints to be ignored.
Product: [Eclipse Project] JDT Reporter: Erin Harris <eharris>
Component: DebugAssignee: Jared Burns <jared_burns>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: jared_burns, sutton
Version: 2.1   
Target Milestone: 3.0 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Erin Harris CLA 2003-05-16 09:16:35 EDT
We register an IJavaBreakpointListener which returns false for the breakpointHit 
method in order not to interfere with how breakpoints are handled (the listener 
is only interested in breakpoint installed events).  However this causes JDT to 
ignore all breakpoints.  It seems that at least one listener has to return true 
in order to stop at the breakpoint, but we do not want to always return true as 
that would interfere with breakpoints that should be ignored.
Comment 1 Erin Harris CLA 2003-05-16 09:19:14 EDT
Can this be fixed for 2.1.1?
Comment 2 Darin Wright CLA 2003-05-16 10:55:47 EDT
(Note: The same problem existed in 2.0)

For 2.1.1 we believe you should be able to return "true" to get things to work 
properly. In 3.0, we need to fix the problem - likely changing the API 
(something we cannot do for 2.1.1).

Can you try this and let us know if it works, or breaks anything else.

Looking at our breakpoint listener, the interaction will be OK. Our listener is 
registered to handle uncaught exceptions and compilation errors. These 
breakpoints are only enabled when the options are on.
Comment 3 Darin Wright CLA 2003-05-16 10:57:29 EDT
If your listener is only registered when needed (i.e. when your launch is 
active), then this should not interfere with our debug options.
Comment 4 Darin Wright CLA 2003-09-04 15:55:26 EDT
Luc, we when have an argeeable fix for this problem, we will need to write 
a "porting guide entry" for this breaking API change. I can help with that when 
you are ready.
Comment 5 Jared Burns CLA 2003-09-29 21:08:39 EDT
Implemented. Changed the IJavaBreakpointListener notification APIs to return an int instead of a 
boolean. Updated JavaDoc and the JDT Debug porting guide.

Please verify, DarinW.
Comment 6 Darin Wright CLA 2003-09-30 17:02:55 EDT
Re-opening. I've modified the javadoc to what (I hope) is more explicit. As 
well, I added 10 tests to verify different voting scenarios - which are 
released to HEAD. There are currently two failures. When there is a vote with 
an "install count" of 1, and a "don't install" count of 2, the breakpoint is 
not installed (and should be). As well, the same problem exists for 
the "suspend vote".
Comment 7 Darin Wright CLA 2003-09-30 19:19:09 EDT
Fixed - changed voting constants to start at non-zero value (since it is used 
as a bit mask, we cannot use "0" to discern any information).

Please verify.
Comment 8 Jared Burns CLA 2003-10-01 21:02:33 EDT
Verified.