Program: 135977
Project: 135977
Buggy source:
/** 
 * Should be called to update the status of a proof step. Searches for an existing SANY marker with the same location as the status. If found, replaces this marker with the appropriate step status marker. If a SANY marker is not found, this is a bug and will be printed out on the console.
 * @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()) {
    IMarker sanyMarker=findSANYMarker(module,location);
    try {
      IMarker newMarker=module.createMarker(statusStringToMarkerType(status.getStatus()));
      Map markerAttributes=new HashMap(2);
      int newCharStart;
      int newCharEnd;
      if (sanyMarker != null) {
        newCharStart=sanyMarker.getAttribute(IMarker.CHAR_START,0);
        newCharEnd=sanyMarker.getAttribute(IMarker.CHAR_END,0);
      }
 else {
        ProverUIActivator.logDebug("String_Node_Str" + location + "String_Node_Str");
        IRegion messageRegion=AdapterFactory.locationToRegion(location);
        newCharStart=messageRegion.getOffset();
        newCharEnd=messageRegion.getOffset() + messageRegion.getLength() - 1;
      }
      IMarker[] existingMarkers=module.findMarkers(ProverHelper.STEP_STATUS_MARKER,true,IResource.DEPTH_ZERO);
      for (int i=0; i < existingMarkers.length; i++) {
        IMarker existingMarker=existingMarkers[i];
        int existingCharStart=existingMarker.getAttribute(IMarker.CHAR_START,-1);
        int existingCharEnd=existingMarker.getAttribute(IMarker.CHAR_END,-1);
        if (existingCharStart < newCharEnd && existingCharEnd > newCharStart) {
          existingMarker.delete();
        }
      }
      markerAttributes.put(IMarker.CHAR_START,new Integer(newCharStart));
      markerAttributes.put(IMarker.CHAR_END,new Integer(newCharEnd));
      newMarker.setAttributes(markerAttributes);
    }
 catch (    CoreException e) {
      ProverUIActivator.logError("String_Node_Str",e);
    }
  }
 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. Searches for an existing SANY marker with the same location as the status. If found, replaces this marker with the appropriate step status marker. If a SANY marker is not found, this is a bug and will be printed out on the console.
 * @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()) {
    IMarker sanyMarker=findSANYMarker(module,location);
    try {
      String markerType=statusStringToMarkerType(status.getStatus());
      if (markerType == null) {
        ProverUIActivator.logDebug("String_Node_Str" + status.getStatus());
        return;
      }
      IMarker newMarker=module.createMarker(markerType);
      Map markerAttributes=new HashMap(2);
      int newCharStart;
      int newCharEnd;
      if (sanyMarker != null) {
        newCharStart=sanyMarker.getAttribute(IMarker.CHAR_START,0);
        newCharEnd=sanyMarker.getAttribute(IMarker.CHAR_END,0);
      }
 else {
        ProverUIActivator.logDebug("String_Node_Str" + location + "String_Node_Str");
        IRegion messageRegion=AdapterFactory.locationToRegion(location);
        newCharStart=messageRegion.getOffset();
        newCharEnd=messageRegion.getOffset() + messageRegion.getLength();
      }
      IMarker[] existingMarkers=module.findMarkers(ProverHelper.STEP_STATUS_MARKER,true,IResource.DEPTH_ZERO);
      for (int i=0; i < existingMarkers.length; i++) {
        IMarker existingMarker=existingMarkers[i];
        int existingCharStart=existingMarker.getAttribute(IMarker.CHAR_START,-1);
        int existingCharEnd=existingMarker.getAttribute(IMarker.CHAR_END,-1);
        if (existingCharStart < newCharEnd && existingCharEnd > newCharStart) {
          existingMarker.delete();
        }
      }
      markerAttributes.put(IMarker.CHAR_START,new Integer(newCharStart));
      markerAttributes.put(IMarker.CHAR_END,new Integer(newCharEnd));
      newMarker.setAttributes(markerAttributes);
    }
 catch (    CoreException e) {
      ProverUIActivator.logError("String_Node_Str",e);
    }
  }
 else {
    ProverUIActivator.logDebug("String_Node_Str" + "String_Node_Str" + status.getStatus() + "String_Node_Str"+ location);
  }
}