Program: 118011
Project: 118011
Buggy source:
/** 
 * DOC amaumont Comment method "addTableForColumnsListeners".
 */
private void addTableForColumnsListeners(){
  tableViewerCreatorForColumns.addCellValueModifiedListener(new ITableCellValueModifiedListener(){
    public void cellValueModified(    TableCellValueModifiedEvent e){
      unselectAllEntriesIfErrorDetected(e);
    }
  }
);
  final TableViewer tableViewerForEntries=tableViewerCreatorForColumns.getTableViewer();
  tableViewerForEntries.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      int[] selectionIndices=tableViewerForEntries.getTable().getSelectionIndices();
      if (selectionIndices.length > 0) {
        selectThisDataMapTableView();
        onSelectedEntries(event.getSelection(),selectionIndices);
        MetadataTableEditorView metadataTableEditorView=null;
        if (getZone() == Zone.INPUTS) {
          metadataTableEditorView=mapperManager.getUiManager().getInputMetaEditorView();
        }
 else         if (getZone() == Zone.OUTPUTS) {
          metadataTableEditorView=mapperManager.getUiManager().getOutputMetaEditorView();
        }
        if (metadataTableEditorView != null) {
          metadataTableEditorView.getTableViewerCreator().refresh();
        }
      }
    }
  }
);
  tableForEntries.addListener(SWT.DragDetect,new Listener(){
    public void handleEvent(    Event event){
      onSelectedEntries(tableViewerForEntries.getSelection(),tableViewerForEntries.getTable().getSelectionIndices());
    }
  }
);
  tableViewerCreatorForColumns.getSelectionHelper().addAfterSelectionListener(new ILineSelectionListener(){
    public void handle(    LineSelectionEvent e){
      if (forceExecuteSelectionEvent) {
        forceExecuteSelectionEvent=false;
        onSelectedEntries(tableViewerForEntries.getSelection(),tableViewerForEntries.getTable().getSelectionIndices());
      }
    }
  }
);
  tableForEntries.addListener(SWT.KeyDown,new Listener(){
    public void handleEvent(    Event event){
      processEnterKeyDown(tableViewerCreatorForColumns,event);
    }
  }
);
  abstractDataMapTable.getTableColumnsEntriesModel().addModifiedBeanListener(new IModifiedBeanListener<IColumnEntry>(){
    public void handleEvent(    ModifiedBeanEvent<IColumnEntry> event){
      TableViewerCreator tableViewerCreator=tableViewerCreatorForColumns;
      ITableEntry tableEntry=event.bean;
      parseExpression(event,tableViewerCreator,tableEntry);
    }
  }
);
  if (abstractDataMapTable instanceof InputTable) {
    InputTable inputTable=(InputTable)abstractDataMapTable;
    inputTable.getTableGlobalMapEntriesModel().addAfterOperationListListener(new IListenableListListener<GlobalMapEntry>(){
      public void handleEvent(      ListenableListEvent<GlobalMapEntry> event){
        if (DataMapTableView.this.canBeResizedAtPreferedSize()) {
          resizeAtExpandedSize();
        }
      }
    }
);
    inputTable.getTableGlobalMapEntriesModel().addModifiedBeanListener(new IModifiedBeanListener<GlobalMapEntry>(){
      public void handleEvent(      ModifiedBeanEvent<GlobalMapEntry> event){
        TableViewerCreator tableViewerCreator=tableViewerCreatorForGlobalMap;
        ITableEntry tableEntry=event.bean;
        parseExpression(event,tableViewerCreator,tableEntry);
      }
    }
);
  }
  if (abstractDataMapTable instanceof OutputTable) {
    OutputTable outputTable=(OutputTable)abstractDataMapTable;
    outputTable.getTableFiltersEntriesModel().addAfterOperationListListener(new IListenableListListener<FilterTableEntry>(){
      public void handleEvent(      ListenableListEvent<FilterTableEntry> event){
        if (DataMapTableView.this.canBeResizedAtPreferedSize()) {
          resizeAtExpandedSize();
        }
      }
    }
);
    outputTable.getTableFiltersEntriesModel().addModifiedBeanListener(new IModifiedBeanListener<FilterTableEntry>(){
      public void handleEvent(      ModifiedBeanEvent<FilterTableEntry> event){
        TableViewerCreator tableViewerCreator=tableViewerCreatorForFilters;
        ITableEntry tableEntry=event.bean;
        parseExpression(event,tableViewerCreator,tableEntry);
      }
    }
);
  }
  tableForEntries.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      if (e.button == 3 && getZone() == Zone.OUTPUTS) {
        Menu mainMenu=new Menu(tableForEntries);
        tableForEntries.setMenu(mainMenu);
        new MenuItem(mainMenu,SWT.SEPARATOR);
        MenuItem customItem=new MenuItem(mainMenu,SWT.PUSH);
        customItem.setText("String_Node_Str");
        final IService service=GlobalServiceRegister.getDefault().getService(IExpressionBuilderDialogService.class);
        customItem.addListener(SWT.Selection,new Listener(){
          public void handleEvent(          Event event){
            IExpressionBuilderDialogController dialogForTable=((IExpressionBuilderDialogService)service).getExpressionBuilderInstance(DataMapTableView.this.getCenterComposite(),null,mapperManager.getAbstractMapComponent(),true);
            if (dialogForTable instanceof TrayDialog) {
              TrayDialog parentDialog=(TrayDialog)dialogForTable;
              dialogForTable.setDefaultExpression(expressionFilterText.getText());
              if (Window.OK == parentDialog.open()) {
                String expressionForTable=dialogForTable.getExpressionForTable();
                TableItem[] selectedTableItems=tableForEntries.getSelection();
                for (                TableItem tableItem : selectedTableItems) {
                  ITableEntry currentModifiedEntry=(ITableEntry)tableItem.getData();
                  String currentExpr=currentModifiedEntry.getExpression();
                  if (expressionForTable != null && !expressionForTable.equals(currentExpr)) {
                    String replacedExpression=expressionForTable;
                    if (!StringUtils.isEmpty(currentExpr)) {
                      replacedExpression=expressionForTable.replace("String_Node_Str",currentExpr);
                    }
                    mapperManager.changeEntryExpression(currentModifiedEntry,replacedExpression);
                    StyledTextHandler textTarget=mapperManager.getUiManager().getTabFolderEditors().getStyledTextHandler();
                    textTarget.setCurrentEntry(currentModifiedEntry);
                    textTarget.setTextWithoutNotifyListeners(replacedExpression);
                    mapperManager.getUiManager().parseNewExpression(replacedExpression,currentModifiedEntry,false);
                  }
                }
              }
            }
          }
        }
);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "addTableForColumnsListeners".
 */
private void addTableForColumnsListeners(){
  tableViewerCreatorForColumns.addCellValueModifiedListener(new ITableCellValueModifiedListener(){
    public void cellValueModified(    TableCellValueModifiedEvent e){
      unselectAllEntriesIfErrorDetected(e);
    }
  }
);
  final TableViewer tableViewerForEntries=tableViewerCreatorForColumns.getTableViewer();
  tableViewerForEntries.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      int[] selectionIndices=tableViewerForEntries.getTable().getSelectionIndices();
      if (selectionIndices.length > 0) {
        selectThisDataMapTableView();
        onSelectedEntries(event.getSelection(),selectionIndices);
        MetadataTableEditorView metadataTableEditorView=null;
        if (getZone() == Zone.INPUTS) {
          metadataTableEditorView=mapperManager.getUiManager().getInputMetaEditorView();
        }
 else         if (getZone() == Zone.OUTPUTS) {
          metadataTableEditorView=mapperManager.getUiManager().getOutputMetaEditorView();
        }
        if (metadataTableEditorView != null) {
          metadataTableEditorView.getTableViewerCreator().refresh();
        }
      }
    }
  }
);
  tableForEntries.addListener(SWT.DragDetect,new Listener(){
    public void handleEvent(    Event event){
      onSelectedEntries(tableViewerForEntries.getSelection(),tableViewerForEntries.getTable().getSelectionIndices());
    }
  }
);
  tableViewerCreatorForColumns.getSelectionHelper().addAfterSelectionListener(new ILineSelectionListener(){
    public void handle(    LineSelectionEvent e){
      if (forceExecuteSelectionEvent) {
        forceExecuteSelectionEvent=false;
        onSelectedEntries(tableViewerForEntries.getSelection(),tableViewerForEntries.getTable().getSelectionIndices());
      }
    }
  }
);
  tableForEntries.addListener(SWT.KeyDown,new Listener(){
    public void handleEvent(    Event event){
      processEnterKeyDown(tableViewerCreatorForColumns,event);
    }
  }
);
  abstractDataMapTable.getTableColumnsEntriesModel().addModifiedBeanListener(new IModifiedBeanListener<IColumnEntry>(){
    public void handleEvent(    ModifiedBeanEvent<IColumnEntry> event){
      TableViewerCreator tableViewerCreator=tableViewerCreatorForColumns;
      ITableEntry tableEntry=event.bean;
      parseExpression(event,tableViewerCreator,tableEntry);
    }
  }
);
  if (abstractDataMapTable instanceof InputTable) {
    InputTable inputTable=(InputTable)abstractDataMapTable;
    inputTable.getTableGlobalMapEntriesModel().addAfterOperationListListener(new IListenableListListener<GlobalMapEntry>(){
      public void handleEvent(      ListenableListEvent<GlobalMapEntry> event){
        if (DataMapTableView.this.canBeResizedAtPreferedSize()) {
          resizeAtExpandedSize();
        }
      }
    }
);
    inputTable.getTableGlobalMapEntriesModel().addModifiedBeanListener(new IModifiedBeanListener<GlobalMapEntry>(){
      public void handleEvent(      ModifiedBeanEvent<GlobalMapEntry> event){
        TableViewerCreator tableViewerCreator=tableViewerCreatorForGlobalMap;
        ITableEntry tableEntry=event.bean;
        parseExpression(event,tableViewerCreator,tableEntry);
      }
    }
);
  }
  if (abstractDataMapTable instanceof OutputTable) {
    OutputTable outputTable=(OutputTable)abstractDataMapTable;
    outputTable.getTableFiltersEntriesModel().addAfterOperationListListener(new IListenableListListener<FilterTableEntry>(){
      public void handleEvent(      ListenableListEvent<FilterTableEntry> event){
        if (DataMapTableView.this.canBeResizedAtPreferedSize()) {
          resizeAtExpandedSize();
        }
      }
    }
);
    outputTable.getTableFiltersEntriesModel().addModifiedBeanListener(new IModifiedBeanListener<FilterTableEntry>(){
      public void handleEvent(      ModifiedBeanEvent<FilterTableEntry> event){
        TableViewerCreator tableViewerCreator=tableViewerCreatorForFilters;
        ITableEntry tableEntry=event.bean;
        parseExpression(event,tableViewerCreator,tableEntry);
      }
    }
);
  }
  tableForEntries.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      if (e.button == 3 && getZone() == Zone.OUTPUTS) {
        Menu mainMenu=new Menu(tableForEntries);
        tableForEntries.setMenu(mainMenu);
        MenuItem customItem=new MenuItem(mainMenu,SWT.PUSH);
        customItem.setText("String_Node_Str");
        final IService service=GlobalServiceRegister.getDefault().getService(IExpressionBuilderDialogService.class);
        customItem.addListener(SWT.Selection,new Listener(){
          public void handleEvent(          Event event){
            IExpressionBuilderDialogController dialogForTable=((IExpressionBuilderDialogService)service).getExpressionBuilderInstance(DataMapTableView.this.getCenterComposite(),null,mapperManager.getAbstractMapComponent(),true);
            if (dialogForTable instanceof TrayDialog) {
              TrayDialog parentDialog=(TrayDialog)dialogForTable;
              dialogForTable.setDefaultExpression(expressionFilterText.getText());
              if (Window.OK == parentDialog.open()) {
                String expressionForTable=dialogForTable.getExpressionForTable();
                TableItem[] selectedTableItems=tableForEntries.getSelection();
                for (                TableItem tableItem : selectedTableItems) {
                  ITableEntry currentModifiedEntry=(ITableEntry)tableItem.getData();
                  String currentExpr=currentModifiedEntry.getExpression();
                  if (expressionForTable != null && !expressionForTable.equals(currentExpr)) {
                    String replacedExpression=expressionForTable;
                    if (!StringUtils.isEmpty(currentExpr)) {
                      replacedExpression=expressionForTable.replace("String_Node_Str",currentExpr);
                    }
                    mapperManager.changeEntryExpression(currentModifiedEntry,replacedExpression);
                    StyledTextHandler textTarget=mapperManager.getUiManager().getTabFolderEditors().getStyledTextHandler();
                    textTarget.setCurrentEntry(currentModifiedEntry);
                    textTarget.setTextWithoutNotifyListeners(replacedExpression);
                    mapperManager.getUiManager().parseNewExpression(replacedExpression,currentModifiedEntry,false);
                  }
                }
              }
            }
          }
        }
);
      }
    }
  }
);
}