Program: 94711
Project: 94711
Buggy source:
public void handleEvent(IContainerEvent event){
  Activator activator=Activator.getDefault();
  if (activator == null)   return;
  final IContainerManager containerManager=activator.getContainerManager();
  if (containerManager == null)   return;
  IContainer container=containerManager.getContainer(event.getLocalContainerID());
  if (container == null)   return;
  if (event instanceof IContainerConnectedEvent || event instanceof IContainerDisconnectedEvent) {
    IChannelContainerAdapter cca=(IChannelContainerAdapter)container.getAdapter(IChannelContainerAdapter.class);
    if (cca == null)     return;
    ID containerID=container.getID();
    if (event instanceof IContainerConnectedEvent) {
      try {
        URLShare.addURLShare(containerID,cca);
      }
 catch (      ECFException e) {
        Activator.getDefault().getLog().log(new Status(IStatus.INFO,Activator.PLUGIN_ID,IStatus.INFO,NLS.bind(Messages.ShareReceiversECFStart_STATUS_URLSHARE_NOT_CREATED,container.getID()),null));
      }
      try {
        ViewShare.addViewShare(containerID,cca);
      }
 catch (      ECFException e) {
        Activator.getDefault().getLog().log(new Status(IStatus.INFO,Activator.PLUGIN_ID,IStatus.INFO,NLS.bind(Messages.ShareReceiversECFStart_STATUS_VIEWSHARE_NOT_CREATED,container.getID()),null));
      }
      try {
        ConsoleShare.addStackShare(containerID,cca);
      }
 catch (      ECFException e) {
        Activator.getDefault().getLog().log(new Status(IStatus.INFO,Activator.PLUGIN_ID,IStatus.INFO,NLS.bind(Messages.ShareReceiversECFStart_STATUS_CAPTURESHARE_NOT_CREATED,container.getID()),null));
      }
      try {
        ScreenCaptureShare.addScreenCaptureShare(containerID,cca);
      }
 catch (      ECFException e) {
        Activator.getDefault().getLog().log(new Status(IStatus.INFO,Activator.PLUGIN_ID,IStatus.INFO,NLS.bind(Messages.ShareReceiversECFStart_STATUS_SCREENCAPTURESHARE_NOT_CREATED,container.getID()),null));
      }
    }
 else     if (event instanceof IContainerDisconnectedEvent || event instanceof IContainerEjectedEvent) {
      URLShare.removeURLShare(containerID);
      ViewShare.removeViewShare(containerID);
      ConsoleShare.removeStackShare(containerID);
      ScreenCaptureShare.removeScreenCaptureShare(containerID);
    }
  }
 else   if (event instanceof IContainerDisposeEvent) {
    containerManager.removeListener(containerManagerListener);
    container.removeListener(containerListener);
  }
}

Fixed version (ground truth):
public void handleEvent(IContainerEvent event){
  Activator activator=Activator.getDefault();
  if (activator == null)   return;
  final IContainerManager containerManager=activator.getContainerManager();
  if (containerManager == null)   return;
  IContainer container=containerManager.getContainer(event.getLocalContainerID());
  if (container == null)   return;
  if (event instanceof IContainerConnectedEvent || event instanceof IContainerDisconnectedEvent) {
    IChannelContainerAdapter cca=(IChannelContainerAdapter)container.getAdapter(IChannelContainerAdapter.class);
    if (cca == null)     return;
    ID containerID=container.getID();
    if (event instanceof IContainerConnectedEvent) {
      try {
        URLShare.addURLShare(containerID,cca);
      }
 catch (      ECFException e) {
        Activator.getDefault().getLog().log(new Status(IStatus.INFO,Activator.PLUGIN_ID,IStatus.INFO,NLS.bind(Messages.ShareReceiversECFStart_STATUS_URLSHARE_NOT_CREATED,container.getID()),null));
      }
      try {
        ViewShare.addViewShare(containerID,cca);
      }
 catch (      ECFException e) {
        Activator.getDefault().getLog().log(new Status(IStatus.INFO,Activator.PLUGIN_ID,IStatus.INFO,NLS.bind(Messages.ShareReceiversECFStart_STATUS_VIEWSHARE_NOT_CREATED,container.getID()),null));
      }
      try {
        ScreenCaptureShare.addScreenCaptureShare(containerID,cca);
      }
 catch (      ECFException e) {
        Activator.getDefault().getLog().log(new Status(IStatus.INFO,Activator.PLUGIN_ID,IStatus.INFO,NLS.bind(Messages.ShareReceiversECFStart_STATUS_SCREENCAPTURESHARE_NOT_CREATED,container.getID()),null));
      }
    }
 else     if (event instanceof IContainerDisconnectedEvent || event instanceof IContainerEjectedEvent) {
      URLShare urlShare=URLShare.removeURLShare(containerID);
      if (urlShare != null) {
        urlShare.dispose();
      }
      ViewShare viewShare=ViewShare.removeViewShare(containerID);
      if (viewShare != null) {
        viewShare.dispose();
      }
      ScreenCaptureShare scShare=ScreenCaptureShare.removeScreenCaptureShare(containerID);
      if (scShare != null) {
        scShare.dispose();
      }
    }
  }
 else   if (event instanceof IContainerDisposeEvent) {
    containerManager.removeListener(containerManagerListener);
    container.removeListener(containerListener);
  }
}