Program: 71616
Project: 71616
Buggy source:
public void toggleLineBreakpoints(IWorkbenchPart part,ISelection selection) throws CoreException {
  DecoratedScriptEditor textEditor=getEditor(part);
  if (textEditor != null) {
    ITextSelection textSelection=(ITextSelection)selection;
    IReportScriptLocation location=(IReportScriptLocation)textEditor.getAdapter(IReportScriptLocation.class);
    if (location == null) {
      return;
    }
    int lineNumber=textSelection.getStartLine();
    if (location.getLineNumber() > 0) {
      lineNumber=location.getLineNumber();
    }
    IResource resource=(IResource)textEditor.getEditorInput().getAdapter(IResource.class);
    if (resource == null) {
      resource=ScriptDebugUtil.getDefaultResource();
    }
    IBreakpoint[] breakpoints=DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IScriptConstants.SCRIPT_DEBUG_MODEL);
    for (int i=0; i < breakpoints.length; i++) {
      IBreakpoint breakpoint=breakpoints[i];
      if (resource.equals(breakpoint.getMarker().getResource())) {
        if (((ScriptLineBreakpoint)breakpoint).getLineNumber() == (lineNumber + 1) && ((ScriptLineBreakpoint)breakpoint).getFileName().equals(location.getReportFileName()) && ((ScriptLineBreakpoint)breakpoint).getSubName().equals(location.getID())) {
          breakpoint.delete();
          return;
        }
      }
    }
    ScriptLineBreakpoint lineBreakpoint=new ScriptLineBreakpoint(resource,location.getReportFileName(),location.getID(),lineNumber + 1);
    lineBreakpoint.setDisplayName(location.getDisplayName());
    DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(lineBreakpoint);
  }
}

Fixed version (ground truth):
public void toggleLineBreakpoints(IWorkbenchPart part,ISelection selection) throws CoreException {
  DecoratedScriptEditor textEditor=getEditor(part);
  if (textEditor != null) {
    ITextSelection textSelection=(ITextSelection)selection;
    IReportScriptLocation location=(IReportScriptLocation)textEditor.getAdapter(IReportScriptLocation.class);
    if (location == null) {
      return;
    }
    int lineNumber=textSelection.getStartLine();
    if (location.getLineNumber() > 0) {
      lineNumber=location.getLineNumber();
    }
    IResource resource=(IResource)textEditor.getEditorInput().getAdapter(IResource.class);
    if (resource == null) {
      resource=ScriptDebugUtil.getDefaultResource();
    }
    IBreakpoint[] breakpoints=DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IScriptConstants.SCRIPT_DEBUG_MODEL);
    for (int i=0; i < breakpoints.length; i++) {
      IBreakpoint breakpoint=breakpoints[i];
      if (resource.equals(breakpoint.getMarker().getResource())) {
        if (((ScriptLineBreakpoint)breakpoint).getLineNumber() == (lineNumber + 1) && ((ScriptLineBreakpoint)breakpoint).getFileName().equals(location.getReportFileName()) && ((ScriptLineBreakpoint)breakpoint).getSubName().equals(location.getID())) {
          breakpoint.delete();
          return;
        }
      }
    }
    ScriptLineBreakpoint lineBreakpoint=new ScriptLineBreakpoint(resource,location.getReportFileName(),location.getID(),lineNumber + 1,location.getDisplayName());
    DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(lineBreakpoint);
  }
}