Program: 135999
Project: 135999
Buggy source:
/** 
 * Should be called to update the status of a proof step. Does nothing if status is null.
 * @param status
 */
public static void newStepStatus(ProofStepStatus status){
  if (status == null) {
    return;
  }
  Location location=status.getLocation();
  IResource module=ResourceHelper.getResourceByModuleName(location.source());
  if (module != null && module instanceof IFile && module.exists()) {
    FileEditorInput fileEditorInput=new FileEditorInput((IFile)module);
    FileDocumentProvider fileDocumentProvider=new FileDocumentProvider();
    try {
      fileDocumentProvider.connect(fileEditorInput);
      IDocument document=fileDocumentProvider.getDocument(fileEditorInput);
      IMarker newMarker=module.createMarker(statusStringToMarkerType(status.getStatus()));
      Map markerAttributes=new HashMap(2);
      IRegion stepRegion=AdapterFactory.locationToRegion(document,location);
      markerAttributes.put(IMarker.CHAR_START,new Integer(stepRegion.getOffset()));
      markerAttributes.put(IMarker.CHAR_END,new Integer(stepRegion.getOffset() + stepRegion.getLength()));
      newMarker.setAttributes(markerAttributes);
      IMarker[] existingMarkers=module.findMarkers(STEP_STATUS_MARKER,true,IResource.DEPTH_ZERO);
      for (int i=0; i < existingMarkers.length; i++) {
        IMarker existingMarker=existingMarkers[i];
        int startChar=existingMarker.getAttribute(IMarker.CHAR_START,-1);
        int endChar=existingMarker.getAttribute(IMarker.CHAR_END,-1);
        if (stepRegion.getOffset() < startChar && stepRegion.getLength() + stepRegion.getOffset() > endChar) {
          existingMarker.delete();
        }
      }
    }
 catch (    CoreException e) {
      ProverUIActivator.logError("String_Node_Str" + "String_Node_Str" + status.getStatus() + "String_Node_Str"+ location,e);
    }
catch (    BadLocationException e) {
      ProverUIActivator.logError("String_Node_Str" + "String_Node_Str" + status.getStatus() + "String_Node_Str"+ location,e);
    }
 finally {
      fileDocumentProvider.disconnect(fileEditorInput);
    }
  }
 else {
    ProverUIActivator.logDebug("String_Node_Str" + "String_Node_Str" + status.getStatus() + "String_Node_Str"+ location);
  }
}

Fixed version (ground truth):
/** 
 * Should be called to update the status of a proof step. Does nothing if status is null.
 * @param status
 */
public static void newStepStatus(ProofStepStatus status){
  if (status == null) {
    return;
  }
  Location location=status.getLocation();
  IResource module=ResourceHelper.getResourceByModuleName(location.source());
  if (module != null && module instanceof IFile && module.exists()) {
    FileEditorInput fileEditorInput=new FileEditorInput((IFile)module);
    FileDocumentProvider fileDocumentProvider=new FileDocumentProvider();
    try {
      fileDocumentProvider.connect(fileEditorInput);
      IDocument document=fileDocumentProvider.getDocument(fileEditorInput);
      IMarker newMarker=module.createMarker(statusStringToMarkerType(status.getStatus()));
      Map markerAttributes=new HashMap(2);
      IRegion stepRegion=AdapterFactory.locationToRegion(document,location);
      markerAttributes.put(IMarker.CHAR_START,new Integer(stepRegion.getOffset()));
      markerAttributes.put(IMarker.CHAR_END,new Integer(stepRegion.getOffset() + stepRegion.getLength() - 1));
      newMarker.setAttributes(markerAttributes);
      IMarker[] existingMarkers=module.findMarkers(STEP_STATUS_MARKER,true,IResource.DEPTH_ZERO);
      for (int i=0; i < existingMarkers.length; i++) {
        IMarker existingMarker=existingMarkers[i];
        int startChar=existingMarker.getAttribute(IMarker.CHAR_START,-1);
        int endChar=existingMarker.getAttribute(IMarker.CHAR_END,-1);
        if (stepRegion.getOffset() < startChar && stepRegion.getLength() + stepRegion.getOffset() > endChar) {
          existingMarker.delete();
        }
      }
    }
 catch (    CoreException e) {
      ProverUIActivator.logError("String_Node_Str" + "String_Node_Str" + status.getStatus() + "String_Node_Str"+ location,e);
    }
catch (    BadLocationException e) {
      ProverUIActivator.logError("String_Node_Str" + "String_Node_Str" + status.getStatus() + "String_Node_Str"+ location,e);
    }
 finally {
      fileDocumentProvider.disconnect(fileEditorInput);
    }
  }
 else {
    ProverUIActivator.logDebug("String_Node_Str" + "String_Node_Str" + status.getStatus() + "String_Node_Str"+ location);
  }
}