Bug 189497 - Adding a java breakpoint exception should enable it
Summary: Adding a java breakpoint exception should enable it
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M5   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed
Depends on:
Blocks:
 
Reported: 2007-05-28 15:18 EDT by Pascal Rapicault CLA
Modified: 2009-12-15 10:20 EST (History)
2 users (show)

See Also:
Michael_Rennie: review+


Attachments
Proposed patch (2.62 KB, patch)
2009-11-27 20:56 EST, j.o. CLA
Michael_Rennie: iplog+
Details | Diff
Updated Fix (4.14 KB, patch)
2009-12-10 15:27 EST, Curtis Windatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2007-05-28 15:18:56 EDT
3.3 rc3
Adding a java breakpoints that is already in the breakpoint list but disabled, should re-enable it.
Steps to reproduce:
- go to the breakpoints view
- click "add a java exception breakpoint"
- select NullPointerException, notice that an entry is added to the view
- in the view, disable the added breakpoint
- click "add a java exception breakpoint"
- select NullPointerException, notice that an entry is not re-enabled.

This is pretty annoying since even though I may at one point have disabled the exception breakpoint, when I go back to the "add a java exception breakpoint", it is that I want this breakpoint to be enabled.
Comment 1 Darin Wright CLA 2007-05-29 11:59:28 EDT
Consider post 3.3
Comment 2 j.o. CLA 2009-11-27 20:56:23 EST
Created attachment 153293 [details]
Proposed patch

Fairly simple fix by appending some code to org.eclipse.jdt.internal.debug.ui.breakpoints.AddExceptionAction.java 

However, I am a bit unsure about some exception handling (see comment in patched code). Hopefully someone with a little more familiarity can clear this up.
Comment 3 Curtis Windatt CLA 2009-12-10 15:27:27 EST
Created attachment 154272 [details]
Updated Fix

There were some issues with your patch:
1. Removed some unecessary logic (the javadoc for setEnabled explicitly states that it does nothing if already enabled)
2. Corrected string NLS, rather than have a constant in the class for strings (which doesn't add any benefit), Eclipse uses a localization class so that different translations can be used.  Look at the patch for example usage.  If you enter a literal string, it should be marked as a warning with a quick fix to open the externalization wizard that will do the work for you.
3. Handled the core exception the same way as other jobs in the class do.  If there is a problem interacting with the breakpoint model the job will fail and display a status dialog to the user.
Comment 4 Curtis Windatt CLA 2009-12-10 15:29:38 EST
Will commit for M5.
Comment 5 Curtis Windatt CLA 2009-12-14 12:24:47 EST
Fixed in HEAD.
Comment 6 Curtis Windatt CLA 2009-12-14 12:25:19 EST
Mike, please verify.
Comment 7 Michael Rennie CLA 2009-12-15 10:20:34 EST
looks fine, I applied a small update to make the breakpoint jobs system + interactive.