Program: 33970
Project: 33970
Buggy source:
private void initCoreService(String userChannel) throws CoreException {
  repository=new Repository(messagingConnector,userChannel);
  liveEditCoordinator=new LiveEditCoordinator(messagingConnector);
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  resourceListener=new CloudSyncResourceListener(repository);
  workspace.addResourceChangeListener(resourceListener,IResourceChangeEvent.POST_CHANGE);
  metadataListener=new CloudSyncMetadataListener(repository);
  workspace.addResourceChangeListener(metadataListener,IResourceChangeEvent.POST_BUILD);
  this.repositoryListener=new IRepositoryListener(){
    @Override public void projectDisconnected(    IProject project){
      removeConnectedProjectPreference(project.getName());
    }
    @Override public void projectConnected(    IProject project){
      addConnectedProjectPreference(project.getName());
    }
  }
;
  getRepository().addRepositoryListener(repositoryListener);
  workspaceListener=new IResourceChangeListener(){
    public void resourceChanged(    IResourceChangeEvent event){
      if (event.getResource() instanceof IProject) {
        IResourceDelta delta=event.getDelta();
        if (delta == null) {
          return;
        }
        if (delta.getKind() == IResourceDelta.REMOVED) {
          IProject project=(IProject)event.getResource();
          removeConnectedProjectPreference(project.getName());
        }
 else         if (delta.getKind() == IResourceDelta.CHANGED) {
        }
      }
    }
  }
;
  workspace.addResourceChangeListener(workspaceListener);
  updateProjectConnections();
}

Fixed version (ground truth):
private void initCoreService(String userChannel) throws CoreException {
  repository=new Repository(messagingConnector,userChannel);
  liveEditCoordinator=new LiveEditCoordinator(messagingConnector);
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  resourceListener=new CloudSyncResourceListener(repository);
  workspace.addResourceChangeListener(resourceListener,IResourceChangeEvent.POST_CHANGE);
  metadataListener=new CloudSyncMetadataListener(repository);
  workspace.addResourceChangeListener(metadataListener,IResourceChangeEvent.POST_BUILD);
  this.repositoryListener=new IRepositoryListener(){
    @Override public void projectDisconnected(    IProject project){
      removeConnectedProjectPreference(project.getName());
    }
    @Override public void projectConnected(    IProject project){
      addConnectedProjectPreference(project.getName());
    }
    @Override public void resourceChanged(    IResource resource){
    }
  }
;
  getRepository().addRepositoryListener(repositoryListener);
  workspaceListener=new IResourceChangeListener(){
    public void resourceChanged(    IResourceChangeEvent event){
      if (event.getResource() instanceof IProject) {
        IResourceDelta delta=event.getDelta();
        if (delta == null) {
          return;
        }
        if (delta.getKind() == IResourceDelta.REMOVED) {
          IProject project=(IProject)event.getResource();
          removeConnectedProjectPreference(project.getName());
        }
 else         if (delta.getKind() == IResourceDelta.CHANGED) {
        }
      }
    }
  }
;
  workspace.addResourceChangeListener(workspaceListener);
  updateProjectConnections();
}