Program: 136061
Project: 136061
Buggy source:
/** 
 * Installs a SANY problem marker on a given resource REFACTOR: remove runable....
 * @param resource resource handle to put the marker on
 * @param moduleName name of the module (usually the resource, but if module not found, the resource will be the project)
 * @param severityError one of the marker severity constants
 * @param coordinates 4 integer numbers (beginline, begincolumn, endline, endcolumn) 
 * @param message message of the marker
 * @param monitor monitor for progress 
 * @param type marker type: {@link TLAMarkerHelper#TOOLBOX_MARKERS_TLAPARSER_MARKER_ID} or {@link TLAMarkerHelper#TOOLBOX_MARKERS_TRANSLATOR_MARKER_ID} 
 */
public static void installProblemMarker(final IResource resource,final String moduleName,final int severityError,final int[] coordinates,final String message,IProgressMonitor monitor,final String type){
  Assert.isNotNull(resource);
  Assert.isNotNull(moduleName);
  Assert.isNotNull(coordinates);
  IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
    public void run(    IProgressMonitor monitor) throws CoreException {
      IMarker marker=resource.createMarker(type);
      marker.setAttribute(IMarker.SEVERITY,severityError);
      marker.setAttribute(IMarker.MESSAGE,message);
      marker.setAttribute(IMarker.LOCATION,AdapterFactory.getFormattedLocation(coordinates,moduleName));
      marker.setAttribute(LOCATION_MODULENAME,moduleName);
      marker.setAttribute(LOCATION_BEGINLINE,coordinates[0]);
      marker.setAttribute(LOCATION_BEGINCOLUMN,coordinates[1]);
      marker.setAttribute(LOCATION_ENDLINE,coordinates[2]);
      marker.setAttribute(LOCATION_ENDCOLUMN,coordinates[3]);
      if (coordinates[0] == coordinates[3] || coordinates[3] == -1) {
        marker.setAttribute(IMarker.LINE_NUMBER,coordinates[0]);
      }
 else {
        IDocument document=null;
        FileEditorInput fileEditorInput=new FileEditorInput((IFile)resource);
        FileDocumentProvider fileDocumentProvider=new FileDocumentProvider();
        fileDocumentProvider.connect(fileEditorInput);
        document=fileDocumentProvider.getDocument(fileEditorInput);
        if (document != null) {
          try {
            IRegion lineRegion=document.getLineInformation(coordinates[0] - 1);
            String textLine=document.get(lineRegion.getOffset(),lineRegion.getLength());
            marker.setAttribute(IMarker.CHAR_START,lineRegion.getOffset() + getRealOffset(textLine,coordinates[1] - 1));
            marker.setAttribute(IMarker.CHAR_END,lineRegion.getOffset() + getRealOffset(textLine,coordinates[3]));
          }
 catch (          BadLocationException e) {
            Activator.logError("String_Node_Str",e);
          }
        }
      }
    }
  }
;
  try {
    resource.getWorkspace().run(runnable,null,IWorkspace.AVOID_UPDATE,monitor);
  }
 catch (  CoreException e) {
    Activator.logError("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Installs a SANY problem marker on a given resource REFACTOR: remove runable....
 * @param resource resource handle to put the marker on
 * @param moduleName name of the module (usually the resource, but if module not found, the resource will be the project)
 * @param severityError one of the marker severity constants
 * @param coordinates 4 integer numbers (beginline, begincolumn, endline, endcolumn) 
 * @param message message of the marker
 * @param monitor monitor for progress 
 * @param type marker type: {@link TLAMarkerHelper#TOOLBOX_MARKERS_TLAPARSER_MARKER_ID} or {@link TLAMarkerHelper#TOOLBOX_MARKERS_TRANSLATOR_MARKER_ID} 
 */
public static void installProblemMarker(final IResource resource,final String moduleName,final int severityError,final int[] coordinates,final String message,IProgressMonitor monitor,final String type){
  Assert.isNotNull(resource);
  Assert.isNotNull(moduleName);
  Assert.isNotNull(coordinates);
  IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
    public void run(    IProgressMonitor monitor) throws CoreException {
      IMarker marker=null;
      if (!resource.exists()) {
        if (Activator.isSpecManagerInstantiated() && Activator.getSpecManager().getSpecLoaded() != null && Activator.getSpecManager().getSpecLoaded().getProject() != null) {
          IProject project=Activator.getSpecManager().getSpecLoaded().getProject();
          marker=project.createMarker(type);
        }
 else {
          return;
        }
      }
 else {
        marker=resource.createMarker(type);
      }
      marker.setAttribute(IMarker.SEVERITY,severityError);
      marker.setAttribute(IMarker.MESSAGE,message);
      marker.setAttribute(IMarker.LOCATION,AdapterFactory.getFormattedLocation(coordinates,moduleName));
      marker.setAttribute(LOCATION_MODULENAME,moduleName);
      marker.setAttribute(LOCATION_BEGINLINE,coordinates[0]);
      marker.setAttribute(LOCATION_BEGINCOLUMN,coordinates[1]);
      marker.setAttribute(LOCATION_ENDLINE,coordinates[2]);
      marker.setAttribute(LOCATION_ENDCOLUMN,coordinates[3]);
      if (coordinates[0] == coordinates[3] || coordinates[3] == -1) {
        marker.setAttribute(IMarker.LINE_NUMBER,coordinates[0]);
      }
 else {
        IDocument document=null;
        FileEditorInput fileEditorInput=new FileEditorInput((IFile)resource);
        FileDocumentProvider fileDocumentProvider=new FileDocumentProvider();
        fileDocumentProvider.connect(fileEditorInput);
        document=fileDocumentProvider.getDocument(fileEditorInput);
        if (document != null) {
          try {
            IRegion lineRegion=document.getLineInformation(coordinates[0] - 1);
            String textLine=document.get(lineRegion.getOffset(),lineRegion.getLength());
            marker.setAttribute(IMarker.CHAR_START,lineRegion.getOffset() + getRealOffset(textLine,coordinates[1] - 1));
            marker.setAttribute(IMarker.CHAR_END,lineRegion.getOffset() + getRealOffset(textLine,coordinates[3]));
          }
 catch (          BadLocationException e) {
            Activator.logError("String_Node_Str",e);
          }
        }
      }
    }
  }
;
  try {
    resource.getWorkspace().run(runnable,null,IWorkspace.AVOID_UPDATE,monitor);
  }
 catch (  CoreException e) {
    Activator.logError("String_Node_Str",e);
  }
}