| Summary: | NPE toggling breakpoints | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Michael Rennie <Michael_Rennie> | ||||
| Component: | Debug | Assignee: | Pawel Piech <pawel.1.piech> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | darin.eclipse, pawel.1.piech | ||||
| Version: | 3.6 | Flags: | darin.eclipse:
review+
|
||||
| Target Milestone: | 3.6 RC1 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 166828 [details] Fix. There's a couple of interesting things in this bug. One issue, is a simple one in that the JavaBreakpointTypeAdapterFactory creates BreakpointTypeContainer objects with a null type. Fixing this bug means that breakpoints which do not have a type will be categorized as "Other". This can happen if the breakpoint marker is already disposed when the content provider looks at it. However, after fixing this the view shows another anomaly: some breakpoints added as "Other" are never removed from the view. After debugging this I traced it to the fact that the added/removed events are being sent in the wrong order when the BPs are added/removed really fast. I don't know the exact reason for this, but I suspect that it's due to the fact that BP events are generated upon a workbench build event, and not immediately after a resource change. The workaround in this patch (cumulative with bug 310879 and bug 311236) is to add a test when processing breakpointsAdded event to check whether the BP is already removed. +1 for bug & patch. Applied/Fixed. |
build: I20100429-1549 using the following test source I had watchpoints on all of the fields and proceeded to toggle them all from the editor, when I got to the third one I got the following exception. public class Foo { int d; int b; int c; } At the time the breakpoints view was visible and was showing grouped by breakpoint type. java.lang.NullPointerException at org.eclipse.debug.ui.BreakpointTypeCategory.equals(BreakpointTypeCategory.java:70) at org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer.equals(BreakpointContainer.java:616) at java.util.ArrayList.indexOf(ArrayList.java:220) at org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer.addBreakpoint(BreakpointContainer.java:296) at org.eclipse.debug.internal.ui.model.elements.BreakpointManagerContentProvider$InputData.createRootContainer(BreakpointManagerContentProvider.java:680) at org.eclipse.debug.internal.ui.model.elements.BreakpointManagerContentProvider$InputData.<init>(BreakpointManagerContentProvider.java:149) at org.eclipse.debug.internal.ui.model.elements.BreakpointManagerContentProvider.getInputData(BreakpointManagerContentProvider.java:927) at org.eclipse.debug.internal.ui.model.elements.BreakpointManagerContentProvider.getChildCount(BreakpointManagerContentProvider.java:963) at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider.retrieveChildCount(ElementContentProvider.java:114) at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider$2.run(ElementContentProvider.java:63) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)