Program: 33975
Project: 33975
Buggy source:
public LiveEditConnector(LiveEditCoordinator liveEditCoordinator,Repository repository){
  this.liveEditCoordinator=liveEditCoordinator;
  this.repository=repository;
  this.resourceMappings=new ConcurrentHashMap<IDocument,String>();
  this.documentMappings=new ConcurrentHashMap<String,IDocument>();
  this.pendingLiveEditStartedResponses=new ConcurrentHashMap<String,PendingLiveEditStartedResponse>();
  this.documentListener=new IDocumentListener(){
    @Override public void documentChanged(    DocumentEvent event){
      sendModelChangedMessage(event);
    }
    @Override public void documentAboutToBeChanged(    DocumentEvent event){
    }
  }
;
  this.fileBufferListener=new IFileBufferListener(){
    @Override public void underlyingFileMoved(    IFileBuffer buffer,    IPath path){
    }
    @Override public void underlyingFileDeleted(    IFileBuffer buffer){
    }
    @Override public void stateValidationChanged(    IFileBuffer buffer,    boolean isStateValidated){
    }
    @Override public void stateChanging(    IFileBuffer buffer){
    }
    @Override public void stateChangeFailed(    IFileBuffer buffer){
    }
    @Override public void dirtyStateChanged(    IFileBuffer buffer,    boolean isDirty){
    }
    @Override public void bufferDisposed(    IFileBuffer buffer){
    }
    @Override public void bufferCreated(    IFileBuffer buffer){
    }
    @Override public void bufferContentReplaced(    IFileBuffer buffer){
      IPath path=buffer.getLocation();
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      IWorkspaceRoot root=workspace.getRoot();
      IResource resource=root.findMember(path);
      if (resource != null) {
        IProject project=resource.getProject();
        String resourcePath=resource.getProjectRelativePath().toString();
        String fullPath=project.getName() + "String_Node_Str" + resourcePath;
        IDocument doc=documentMappings.get(fullPath);
        if (doc != null) {
          doc.addDocumentListener(documentListener);
        }
      }
      System.out.println("String_Node_Str");
    }
    @Override public void bufferContentAboutToBeReplaced(    IFileBuffer buffer){
      IPath path=buffer.getLocation();
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      IWorkspaceRoot root=workspace.getRoot();
      IResource resource=root.findMember(path);
      if (resource != null) {
        IProject project=resource.getProject();
        String resourcePath=resource.getProjectRelativePath().toString();
        String fullPath=project.getName() + "String_Node_Str" + resourcePath;
        IDocument doc=documentMappings.get(fullPath);
        if (doc != null) {
          doc.removeDocumentListener(documentListener);
        }
      }
    }
  }
;
  FileBuffers.getTextFileBufferManager().addFileBufferListener(fileBufferListener);
  this.repositoryListener=new IRepositoryListener(){
    @Override public void projectConnected(    IProject project){
      connectOpenEditors(project);
    }
    @Override public void projectDisconnected(    IProject project){
      disconnectOpenEditors(project);
    }
  }
;
  this.repository.addRepositoryListener(repositoryListener);
  this.liveEditConnector=new ILiveEditConnector(){
    @Override public String getConnectorID(){
      return LIVE_EDIT_CONNECTOR_ID;
    }
    @Override public void liveEditingEvent(    String username,    String resourcePath,    int offset,    int removeCount,    String newText){
      handleModelChanged(username,resourcePath,offset,removeCount,newText);
    }
    @Override public void liveEditingStarted(    String requestSenderID,    int callbackID,    String username,    String resourcePath,    String hash,    long timestamp){
      remoteEditorStarted(requestSenderID,callbackID,username,resourcePath,hash,timestamp);
    }
    @Override public void liveEditingStartedResponse(    String requestSenderID,    int callbackID,    String username,    String projectName,    String resourcePath,    String savePointHash,    long savePointTimestamp,    String content){
      handleRemoteLiveContent(requestSenderID,callbackID,username,projectName,resourcePath,savePointHash,savePointTimestamp,content);
    }
    @Override public void liveEditors(    String requestSenderID,    int callbackID,    String username,    String projectRegEx,    String resourceRegEx){
      handleLiveEditors(requestSenderID,callbackID,username,projectRegEx,resourceRegEx);
    }
  }
;
  this.liveEditCoordinator.addLiveEditConnector(liveEditConnector);
  this.workspaceListener=new IResourceChangeListener(){
    @Override public void resourceChanged(    IResourceChangeEvent event){
      reactToResourceChanged(event);
    }
  }
;
  ResourcesPlugin.getWorkspace().addResourceChangeListener(workspaceListener);
  this.partListener=new IPartListener2(){
    @Override public void partVisible(    IWorkbenchPartReference partRef){
    }
    @Override public void partOpened(    IWorkbenchPartReference partRef){
      IWorkbenchPart part=partRef.getPart(false);
      if (part instanceof AbstractTextEditor) {
        connectEditor((AbstractTextEditor)part);
      }
    }
    @Override public void partInputChanged(    IWorkbenchPartReference partRef){
    }
    @Override public void partHidden(    IWorkbenchPartReference partRef){
    }
    @Override public void partDeactivated(    IWorkbenchPartReference partRef){
    }
    @Override public void partClosed(    IWorkbenchPartReference partRef){
      IWorkbenchPart part=partRef.getPart(false);
      if (part instanceof AbstractTextEditor) {
        disconnectEditor((AbstractTextEditor)part);
      }
    }
    @Override public void partBroughtToTop(    IWorkbenchPartReference partRef){
    }
    @Override public void partActivated(    IWorkbenchPartReference partRef){
    }
  }
;
  PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){
    public void run(){
      IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      window.getActivePage().addPartListener(partListener);
    }
  }
);
  for (  ConnectedProject connectedProject : repository.getConnectedProjects()) {
    connectOpenEditors(connectedProject.getProject());
  }
}

Fixed version (ground truth):
public LiveEditConnector(LiveEditCoordinator liveEditCoordinator,Repository repository){
  this.liveEditCoordinator=liveEditCoordinator;
  this.repository=repository;
  this.resourceMappings=new ConcurrentHashMap<IDocument,String>();
  this.documentMappings=new ConcurrentHashMap<String,IDocument>();
  this.pendingLiveEditStartedResponses=new ConcurrentHashMap<String,PendingLiveEditStartedResponse>();
  this.documentListener=new IDocumentListener(){
    @Override public void documentChanged(    DocumentEvent event){
      sendModelChangedMessage(event);
    }
    @Override public void documentAboutToBeChanged(    DocumentEvent event){
    }
  }
;
  this.fileBufferListener=new IFileBufferListener(){
    @Override public void underlyingFileMoved(    IFileBuffer buffer,    IPath path){
    }
    @Override public void underlyingFileDeleted(    IFileBuffer buffer){
    }
    @Override public void stateValidationChanged(    IFileBuffer buffer,    boolean isStateValidated){
    }
    @Override public void stateChanging(    IFileBuffer buffer){
    }
    @Override public void stateChangeFailed(    IFileBuffer buffer){
    }
    @Override public void dirtyStateChanged(    IFileBuffer buffer,    boolean isDirty){
    }
    @Override public void bufferDisposed(    IFileBuffer buffer){
    }
    @Override public void bufferCreated(    IFileBuffer buffer){
    }
    @Override public void bufferContentReplaced(    IFileBuffer buffer){
      IPath path=buffer.getLocation();
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      IWorkspaceRoot root=workspace.getRoot();
      IResource resource=root.findMember(path);
      if (resource != null) {
        IProject project=resource.getProject();
        String resourcePath=resource.getProjectRelativePath().toString();
        String fullPath=project.getName() + "String_Node_Str" + resourcePath;
        IDocument doc=documentMappings.get(fullPath);
        if (doc != null) {
          doc.addDocumentListener(documentListener);
        }
        Repository repository=LiveEditConnector.this.repository;
        if (repository.isConnected(project)) {
          ConnectedProject connectedProject=repository.getProject(project);
          String hash=connectedProject.getHash(resourcePath);
          long timestamp=connectedProject.getTimestamp(resourcePath);
          LiveEditConnector.this.liveEditCoordinator.sendLiveEditStartedMessage(LIVE_EDIT_CONNECTOR_ID,repository.getUsername(),project.getName(),resourcePath,hash,timestamp);
        }
      }
    }
    @Override public void bufferContentAboutToBeReplaced(    IFileBuffer buffer){
      IPath path=buffer.getLocation();
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      IWorkspaceRoot root=workspace.getRoot();
      IResource resource=root.findMember(path);
      if (resource != null) {
        IProject project=resource.getProject();
        String resourcePath=resource.getProjectRelativePath().toString();
        String fullPath=project.getName() + "String_Node_Str" + resourcePath;
        IDocument doc=documentMappings.get(fullPath);
        if (doc != null) {
          doc.removeDocumentListener(documentListener);
        }
      }
    }
  }
;
  FileBuffers.getTextFileBufferManager().addFileBufferListener(fileBufferListener);
  this.repositoryListener=new IRepositoryListener(){
    @Override public void projectConnected(    IProject project){
      connectOpenEditors(project);
    }
    @Override public void projectDisconnected(    IProject project){
      disconnectOpenEditors(project);
    }
    @Override public void resourceChanged(    IResource resource){
      IFileBuffer fileBuffer=FileBuffers.getTextFileBufferManager().getFileBuffer(resource.getLocation(),LocationKind.NORMALIZE);
      if (fileBuffer != null) {
        try {
          fileBuffer.revert(new NullProgressMonitor());
        }
 catch (        CoreException e) {
          e.printStackTrace();
        }
      }
    }
  }
;
  this.repository.addRepositoryListener(repositoryListener);
  this.liveEditConnector=new ILiveEditConnector(){
    @Override public String getConnectorID(){
      return LIVE_EDIT_CONNECTOR_ID;
    }
    @Override public void liveEditingEvent(    String username,    String resourcePath,    int offset,    int removeCount,    String newText){
      handleModelChanged(username,resourcePath,offset,removeCount,newText);
    }
    @Override public void liveEditingStarted(    String requestSenderID,    int callbackID,    String username,    String resourcePath,    String hash,    long timestamp){
      remoteEditorStarted(requestSenderID,callbackID,username,resourcePath,hash,timestamp);
    }
    @Override public void liveEditingStartedResponse(    String requestSenderID,    int callbackID,    String username,    String projectName,    String resourcePath,    String savePointHash,    long savePointTimestamp,    String content){
      handleRemoteLiveContent(requestSenderID,callbackID,username,projectName,resourcePath,savePointHash,savePointTimestamp,content);
    }
    @Override public void liveEditors(    String requestSenderID,    int callbackID,    String username,    String projectRegEx,    String resourceRegEx){
      handleLiveEditors(requestSenderID,callbackID,username,projectRegEx,resourceRegEx);
    }
  }
;
  this.liveEditCoordinator.addLiveEditConnector(liveEditConnector);
  this.workspaceListener=new IResourceChangeListener(){
    @Override public void resourceChanged(    IResourceChangeEvent event){
      reactToResourceChanged(event);
    }
  }
;
  ResourcesPlugin.getWorkspace().addResourceChangeListener(workspaceListener);
  this.partListener=new IPartListener2(){
    @Override public void partVisible(    IWorkbenchPartReference partRef){
    }
    @Override public void partOpened(    IWorkbenchPartReference partRef){
      IWorkbenchPart part=partRef.getPart(false);
      if (part instanceof AbstractTextEditor) {
        connectEditor((AbstractTextEditor)part);
      }
    }
    @Override public void partInputChanged(    IWorkbenchPartReference partRef){
    }
    @Override public void partHidden(    IWorkbenchPartReference partRef){
    }
    @Override public void partDeactivated(    IWorkbenchPartReference partRef){
    }
    @Override public void partClosed(    IWorkbenchPartReference partRef){
      IWorkbenchPart part=partRef.getPart(false);
      if (part instanceof AbstractTextEditor) {
        disconnectEditor((AbstractTextEditor)part);
      }
    }
    @Override public void partBroughtToTop(    IWorkbenchPartReference partRef){
    }
    @Override public void partActivated(    IWorkbenchPartReference partRef){
    }
  }
;
  PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){
    public void run(){
      IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      window.getActivePage().addPartListener(partListener);
    }
  }
);
  for (  ConnectedProject connectedProject : repository.getConnectedProjects()) {
    connectOpenEditors(connectedProject.getProject());
  }
}