Program: 26381
Project: 26381
Buggy source:
/** 
 * Create table of tern modules.
 * @param ancestor
 */
private void createModulesMaster(Composite ancestor){
  Composite parent=new Composite(ancestor,SWT.NULL);
  GridLayout layout=new GridLayout();
  layout.numColumns=2;
  layout.marginHeight=0;
  layout.marginWidth=0;
  parent.setLayout(layout);
  Font font=ancestor.getFont();
  parent.setFont(font);
  Table table=new Table(parent,SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION| SWT.V_SCROLL);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.widthHint=350;
  table.setLayoutData(data);
  table.setFont(parent.getFont());
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  tableViewer=new CheckboxTableViewer(table);
  TableViewerColumn nameColumn=new TableViewerColumn(tableViewer,SWT.NONE);
  nameColumn.getColumn().setWidth(180);
  nameColumn.getColumn().setResizable(true);
  nameColumn.getColumn().setText(TernUIMessages.TernModulesBlock_moduleName);
  nameColumn.getColumn().addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      sortByName();
    }
  }
);
  TableViewerColumn versionColumn=new TableViewerColumn(tableViewer,SWT.NONE);
  versionColumn.getColumn().setWidth(100);
  versionColumn.getColumn().setResizable(true);
  versionColumn.getColumn().setText(TernUIMessages.TernModulesBlock_moduleVersion);
  versionColumn.setEditingSupport(new TernModuleVersionEditingSupport(tableViewer));
  tableViewer.setLabelProvider(TernModuleLabelProvider.getInstance());
  tableViewer.setContentProvider(ArrayContentProvider.getInstance());
  tableViewer.addCheckStateListener(new ICheckStateListener(){
    private boolean checkUpdating;
    @Override public void checkStateChanged(    CheckStateChangedEvent e){
      if (checkUpdating) {
        return;
      }
      try {
        checkUpdating=true;
        if (e.getChecked() && isSelectDependencies()) {
          ITernModule module=((ITernModule)e.getElement());
          TernModuleMetadata metadata=module.getMetadata();
          if (metadata != null) {
            ITernModule dependencyModule=null;
            for (            String moduleName : metadata.getDependencies()) {
              dependencyModule=TernCorePlugin.getTernServerTypeManager().findTernModule(moduleName);
              if (dependencyModule != null) {
                if (!tableViewer.getChecked(dependencyModule)) {
                  tableViewer.setChecked(dependencyModule,true);
                }
              }
            }
          }
        }
      }
  finally {
        checkUpdating=false;
      }
    }
  }
);
  addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent e){
      if (!e.getSelection().isEmpty()) {
        ITernModule module=(ITernModule)((IStructuredSelection)e.getSelection()).getFirstElement();
        refreshModule(module);
      }
 else {
        refreshModule(null);
      }
    }
  }
);
  restoreColumnSettings();
}

Fixed version (ground truth):
/** 
 * Create table of tern modules.
 * @param ancestor
 */
private void createModulesMaster(Composite ancestor){
  Composite parent=new Composite(ancestor,SWT.NULL);
  GridLayout layout=new GridLayout();
  layout.numColumns=2;
  layout.marginHeight=0;
  layout.marginWidth=0;
  parent.setLayout(layout);
  Font font=ancestor.getFont();
  parent.setFont(font);
  Table table=new Table(parent,SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION| SWT.V_SCROLL);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.widthHint=350;
  table.setLayoutData(data);
  table.setFont(parent.getFont());
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  tableViewer=new CheckboxTableViewer(table);
  TableViewerColumn nameColumn=new TableViewerColumn(tableViewer,SWT.NONE);
  nameColumn.getColumn().setWidth(180);
  nameColumn.getColumn().setResizable(true);
  nameColumn.getColumn().setText(TernUIMessages.TernModulesBlock_moduleName);
  nameColumn.getColumn().addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      sortByName();
    }
  }
);
  TableViewerColumn versionColumn=new TableViewerColumn(tableViewer,SWT.NONE);
  versionColumn.getColumn().setWidth(100);
  versionColumn.getColumn().setResizable(true);
  versionColumn.getColumn().setText(TernUIMessages.TernModulesBlock_moduleVersion);
  versionColumn.setEditingSupport(new TernModuleVersionEditingSupport(tableViewer));
  tableViewer.setLabelProvider(TernModuleLabelProvider.getInstance());
  tableViewer.setContentProvider(ArrayContentProvider.getInstance());
  tableViewer.addCheckStateListener(new ICheckStateListener(){
    private boolean checkUpdating;
    @Override public void checkStateChanged(    CheckStateChangedEvent e){
      if (checkUpdating) {
        return;
      }
      try {
        checkUpdating=true;
        if (e.getChecked() && isSelectDependencies()) {
          ITernModule module=((ITernModule)e.getElement());
          TernModuleMetadata metadata=module.getMetadata();
          if (metadata != null) {
            ITernModule dependencyModule=null;
            for (            String moduleName : metadata.getDependencies()) {
              dependencyModule=ternModules.get(moduleName);
              if (dependencyModule != null) {
                if (!tableViewer.getChecked(dependencyModule)) {
                  tableViewer.setChecked(dependencyModule,true);
                }
              }
            }
          }
        }
      }
  finally {
        checkUpdating=false;
      }
    }
  }
);
  addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent e){
      if (!e.getSelection().isEmpty()) {
        ITernModule module=(ITernModule)((IStructuredSelection)e.getSelection()).getFirstElement();
        refreshModule(module);
      }
 else {
        refreshModule(null);
      }
    }
  }
);
  restoreColumnSettings();
}