Program: 57452
Project: 57452
Buggy source:
private void updateSubTree(final SelectionManager selectionManager){
  if (parentComposite.isDisposed())   return;
  parentComposite.getDisplay().asyncExec(new Runnable(){
    @Override public void run(){
      IDType idType=selectionManager.getIDType();
      IDCategory idCategory=idType.getIDCategory();
      if (idType.getIDCategory().getPrimaryMappingType() == null)       return;
      Set<Integer> mouseOverIDs=selectionManager.getElements(SelectionType.MOUSE_OVER);
      Set<Integer> selectedIDs=selectionManager.getElements(SelectionType.SELECTION);
      if (!selectionManagerToSubTree.containsKey(selectionManager) && (mouseOverIDs.size() > 0 || selectedIDs.size() > 0)) {
        TreeItem idCategorySubTree=new TreeItem(selectionTree,SWT.NONE);
        idCategorySubTree.setExpanded(true);
        idCategorySubTree.setData(-1);
        idCategorySubTree.setText(idCategory.getDenominationPlural());
        selectionManagerToSubTree.put(selectionManager,idCategorySubTree);
      }
      TreeItem subTree=selectionManagerToSubTree.get(selectionManager);
      for (      TreeItem item : subTree.getItems()) {
        item.dispose();
      }
      subTree.clearAll(true);
      createItems(subTree,SelectionType.MOUSE_OVER,mouseOverIDs,idType);
      createItems(subTree,SelectionType.SELECTION,selectedIDs,idType);
      int numberElements=IDMappingManagerRegistry.get().getIDMappingManager(idType).getPrimaryTypeCounter();
      int selectedRecords=selectionManager.getNumberOfElements(SelectionType.SELECTION);
      float selectedRecordsPercentage=selectedRecords / (float)numberElements * 100f;
      if (numberElements != 0) {
        subTree.setText(idType.getIDCategory().getDenominationPlural() + "String_Node_Str" + selectedRecords+ "String_Node_Str"+ numberElements+ "String_Node_Str"+ Formatter.formatNumber(selectedRecordsPercentage)+ "String_Node_Str");
      }
    }
  }
);
}

Fixed version (ground truth):
private void updateSubTree(final SelectionManager selectionManager){
  if (parentComposite.isDisposed())   return;
  parentComposite.getDisplay().asyncExec(new Runnable(){
    @Override public void run(){
      IDType idType=selectionManager.getIDType();
      IDCategory idCategory=idType.getIDCategory();
      if (idType.getIDCategory().getPrimaryMappingType() == null)       return;
      Set<Integer> mouseOverIDs=selectionManager.getElements(SelectionType.MOUSE_OVER);
      Set<Integer> selectedIDs=selectionManager.getElements(SelectionType.SELECTION);
      if (!selectionManagerToSubTree.containsKey(selectionManager) && (mouseOverIDs.size() > 0 || selectedIDs.size() > 0)) {
        TreeItem idCategorySubTree=new TreeItem(selectionTree,SWT.NONE);
        idCategorySubTree.setExpanded(true);
        idCategorySubTree.setData(-1);
        idCategorySubTree.setText(idCategory.getDenominationPlural());
        selectionManagerToSubTree.put(selectionManager,idCategorySubTree);
      }
      TreeItem subTree=selectionManagerToSubTree.get(selectionManager);
      if (subTree == null)       return;
      for (      TreeItem item : subTree.getItems()) {
        item.dispose();
      }
      subTree.clearAll(true);
      createItems(subTree,SelectionType.MOUSE_OVER,mouseOverIDs,idType);
      createItems(subTree,SelectionType.SELECTION,selectedIDs,idType);
      int numberElements=IDMappingManagerRegistry.get().getIDMappingManager(idType).getPrimaryTypeCounter();
      int selectedRecords=selectionManager.getNumberOfElements(SelectionType.SELECTION);
      float selectedRecordsPercentage=selectedRecords / (float)numberElements * 100f;
      if (numberElements != 0) {
        subTree.setText(idType.getIDCategory().getDenominationPlural() + "String_Node_Str" + selectedRecords+ "String_Node_Str"+ numberElements+ "String_Node_Str"+ Formatter.formatNumber(selectedRecordsPercentage)+ "String_Node_Str");
      }
    }
  }
);
}