Program: 11734
Project: 11734
Buggy source:
public void scheduleValidation(){
  if (validationJob == null && (dialogSettings == null || dialogSettings.getBoolean(LiveValidationAction.LIVE_VALIDATOR_DIALOG_SETTINGS_KEY))) {
    validationJob=new Job("String_Node_Str"){
      @Override protected IStatus run(      final IProgressMonitor monitor){
        Diagnostician diagnostician=new Diagnostician(){
          @Override public String getObjectLabel(          EObject eObject){
            String text=labelProvider != null && eObject.eIsProxy() ? ((InternalEObject)eObject).eProxyURI().toString() : labelProvider.getText(eObject);
            if (text == null || text.length() == 0) {
              text="String_Node_Str";
            }
 else {
              text=escapeContent(text);
            }
            Image image=labelProvider != null ? labelProvider.getImage(eObject) : null;
            if (image != null) {
              URI imageURI=ImageURIRegistry.INSTANCE.getImageURI(image);
              return enquote("String_Node_Str" + imageURI + "String_Node_Str"+ text);
            }
 else {
              return escapeContent(text);
            }
          }
          @Override public boolean validate(          EClass eClass,          EObject eObject,          DiagnosticChain diagnostics,          Map<Object,Object> context){
            monitor.worked(1);
            return super.validate(eClass,eObject,diagnostics,context);
          }
        }
;
        final ResourceSet resourceSet=editingDomain.getResourceSet();
        List<Resource> resources=new ArrayList<Resource>(Arrays.asList(scheduledResources.toArray(new Resource[0])));
        scheduledResources.removeAll(resources);
        int count=0;
        for (        Resource resource : resources) {
synchronized (resource) {
synchronized (resourceSet) {
              for (Iterator<EObject> i=resource.getAllContents(); i.hasNext(); ) {
                ++count;
                EObject eObject=i.next();
                for (                @SuppressWarnings("String_Node_Str") EObject eCrossReference : eObject.eCrossReferences()) {
                }
              }
            }
          }
        }
        for (List<Resource> moreResources=Arrays.asList(scheduledResources.toArray(new Resource[0])); !moreResources.isEmpty(); moreResources=Arrays.asList(scheduledResources.toArray(new Resource[0]))) {
          resources.addAll(moreResources);
          scheduledResources.removeAll(moreResources);
          for (          Resource resource : moreResources) {
synchronized (resource) {
synchronized (resourceSet) {
                for (Iterator<EObject> i=resource.getAllContents(); i.hasNext(); ) {
                  ++count;
                  EObject eObject=i.next();
                  for (                  @SuppressWarnings("String_Node_Str") EObject eCrossReference : eObject.eCrossReferences()) {
                  }
                }
              }
            }
          }
        }
        monitor.beginTask("String_Node_Str",count);
        final BasicDiagnostic diagnostic=new BasicDiagnostic(EObjectValidator.DIAGNOSTIC_SOURCE,0,EMFEditUIPlugin.INSTANCE.getString("String_Node_Str",new String[]{"String_Node_Str" + resources.size()}),new Object[]{resourceSet});
        Map<Object,Object> context=diagnostician.createDefaultContext();
        for (int i=0; i < resources.size(); ++i) {
          Resource resource=resources.get(i);
          monitor.setTaskName(EMFEditUIPlugin.INSTANCE.getString("String_Node_Str",new Object[]{resource.getURI()}));
          final BasicDiagnostic resourceDiagnostic=new BasicDiagnostic(EObjectValidator.DIAGNOSTIC_SOURCE,0,EMFEditUIPlugin.INSTANCE.getString("String_Node_Str",new String[]{"String_Node_Str"}),new Object[]{resource});
synchronized (resource) {
synchronized (resourceSet) {
              for (              EObject eObject : resource.getContents()) {
                diagnostician.validate(eObject,resourceDiagnostic,context);
              }
            }
          }
          for (          Resource.Diagnostic warning : resource.getWarnings()) {
            resourceDiagnostic.add(new BasicDiagnostic(Diagnostic.WARNING,null,0,warning.getMessage(),new Object[]{resource}));
          }
          for (          Resource.Diagnostic error : resource.getErrors()) {
            resourceDiagnostic.add(new BasicDiagnostic(Diagnostic.ERROR,null,0,error.getMessage(),new Object[]{resource}));
          }
          diagnostic.add(resourceDiagnostic);
          if (monitor.isCanceled()) {
            validationJob=null;
            return Status.CANCEL_STATUS;
          }
          monitor.worked(1);
        }
        DiagnosticAdapter.update(resourceSet,diagnostic);
        Display.getDefault().asyncExec(new Runnable(){
          public void run(){
            validationJob=null;
            if (!scheduledResources.isEmpty()) {
              LiveValidator.this.scheduleValidation();
            }
          }
        }
);
        return Status.OK_STATUS;
      }
    }
;
    validationJob.setPriority(Job.DECORATE);
    validationJob.schedule(500);
  }
}

Fixed version (ground truth):
public void scheduleValidation(){
  if (validationJob == null && (dialogSettings == null || dialogSettings.getBoolean(LiveValidationAction.LIVE_VALIDATOR_DIALOG_SETTINGS_KEY))) {
    validationJob=new Job("String_Node_Str"){
      @Override protected IStatus run(      final IProgressMonitor monitor){
        Diagnostician diagnostician=new Diagnostician(){
          @Override public String getObjectLabel(          EObject eObject){
            String text=labelProvider != null && eObject.eIsProxy() ? ((InternalEObject)eObject).eProxyURI().toString() : labelProvider.getText(eObject);
            if (text == null || text.length() == 0) {
              text="String_Node_Str";
            }
 else {
              text=escapeContent(text);
            }
            Image image=labelProvider != null ? labelProvider.getImage(eObject) : null;
            if (image != null) {
              URI imageURI=ImageURIRegistry.INSTANCE.getImageURI(image);
              return enquote("String_Node_Str" + imageURI + "String_Node_Str"+ text);
            }
 else {
              return escapeContent(text);
            }
          }
          @Override public boolean validate(          EClass eClass,          EObject eObject,          DiagnosticChain diagnostics,          Map<Object,Object> context){
            monitor.worked(1);
            return super.validate(eClass,eObject,diagnostics,context);
          }
        }
;
        final ResourceSet resourceSet=editingDomain.getResourceSet();
        List<Resource> resources=new UniqueEList<Resource>(Arrays.asList(scheduledResources.toArray(new Resource[0])));
        scheduledResources.removeAll(resources);
        int count=0;
        for (        Resource resource : resources) {
synchronized (resource) {
synchronized (resourceSet) {
              for (Iterator<EObject> i=resource.getAllContents(); i.hasNext(); ) {
                ++count;
                EObject eObject=i.next();
                for (                @SuppressWarnings("String_Node_Str") EObject eCrossReference : eObject.eCrossReferences()) {
                }
              }
            }
          }
        }
        for (List<Resource> moreResources=Arrays.asList(scheduledResources.toArray(new Resource[0])); !moreResources.isEmpty(); moreResources=Arrays.asList(scheduledResources.toArray(new Resource[0]))) {
          resources.addAll(moreResources);
          scheduledResources.removeAll(moreResources);
          for (          Resource resource : moreResources) {
synchronized (resource) {
synchronized (resourceSet) {
                for (Iterator<EObject> i=resource.getAllContents(); i.hasNext(); ) {
                  ++count;
                  EObject eObject=i.next();
                  for (                  @SuppressWarnings("String_Node_Str") EObject eCrossReference : eObject.eCrossReferences()) {
                  }
                }
              }
            }
          }
        }
        monitor.beginTask("String_Node_Str",count);
        final BasicDiagnostic diagnostic=new BasicDiagnostic(EObjectValidator.DIAGNOSTIC_SOURCE,0,EMFEditUIPlugin.INSTANCE.getString("String_Node_Str",new String[]{"String_Node_Str" + resources.size()}),new Object[]{resourceSet});
        Map<Object,Object> context=diagnostician.createDefaultContext();
        for (int i=0; i < resources.size(); ++i) {
          Resource resource=resources.get(i);
          monitor.setTaskName(EMFEditUIPlugin.INSTANCE.getString("String_Node_Str",new Object[]{resource.getURI()}));
          final BasicDiagnostic resourceDiagnostic=new BasicDiagnostic(EObjectValidator.DIAGNOSTIC_SOURCE,0,EMFEditUIPlugin.INSTANCE.getString("String_Node_Str",new String[]{"String_Node_Str"}),new Object[]{resource});
synchronized (resource) {
synchronized (resourceSet) {
              for (              EObject eObject : resource.getContents()) {
                diagnostician.validate(eObject,resourceDiagnostic,context);
              }
            }
          }
          for (          Resource.Diagnostic warning : resource.getWarnings()) {
            resourceDiagnostic.add(new BasicDiagnostic(Diagnostic.WARNING,null,0,warning.getMessage(),new Object[]{resource}));
          }
          for (          Resource.Diagnostic error : resource.getErrors()) {
            resourceDiagnostic.add(new BasicDiagnostic(Diagnostic.ERROR,null,0,error.getMessage(),new Object[]{resource}));
          }
          diagnostic.add(resourceDiagnostic);
          if (monitor.isCanceled()) {
            validationJob=null;
            return Status.CANCEL_STATUS;
          }
          monitor.worked(1);
        }
        DiagnosticAdapter.update(resourceSet,diagnostic);
        Display.getDefault().asyncExec(new Runnable(){
          public void run(){
            validationJob=null;
            if (!scheduledResources.isEmpty()) {
              LiveValidator.this.scheduleValidation();
            }
          }
        }
);
        return Status.OK_STATUS;
      }
    }
;
    validationJob.setPriority(Job.DECORATE);
    validationJob.schedule(500);
  }
}