Program: 121162
Project: 121162
Buggy source:
protected ExtendedTextCellEditor createExpressionCellEditor(final TableViewerCreator tableViewerCreator,TableViewerCreatorColumn column,final Zone[] zones,boolean isConstraintExpressionCellEditor){
  IService expressionBuilderDialogService=GlobalServiceRegister.getDefault().getService(IExpressionBuilderDialogService.class);
  CellEditorDialogBehavior behavior=new CellEditorDialogBehavior();
  final ExtendedTextCellEditorWithProposal cellEditor=new ExtendedTextCellEditorWithProposal(tableViewerCreator.getTable(),SWT.MULTI | SWT.BORDER,column,behavior){
    @Override public void activate(){
      super.activate();
    }
  }
;
  dialog=((IExpressionBuilderDialogService)expressionBuilderDialogService).getExpressionBuilderInstance(tableViewerCreator.getCompositeParent(),cellEditor,mapperManager.getAbstractMapComponent());
  behavior.setCellEditorDialog(dialog);
  final Text expressionTextEditor=cellEditor.getTextControl();
  if (isConstraintExpressionCellEditor) {
    constraintExpressionTextEditor=expressionTextEditor;
  }
 else {
    columnExpressionTextEditor=expressionTextEditor;
  }
  cellEditor.addListener(new ICellEditorListener(){
    Text text=expressionTextEditor;
    public void applyEditorValue(){
      ModifiedObjectInfo modifiedObjectInfo=tableViewerCreator.getModifiedObjectInfo();
      mapperManager.getUiManager().parseNewExpression(text.getText(),(ITableEntry)modifiedObjectInfo.getCurrentModifiedBean(),true);
    }
    public void cancelEditor(){
      ModifiedObjectInfo modifiedObjectInfo=tableViewerCreator.getModifiedObjectInfo();
      text.setText((String)modifiedObjectInfo.getOriginalPropertyBeanValue());
      ITableEntry tableEntry=(ITableEntry)(modifiedObjectInfo.getCurrentModifiedBean() != null ? modifiedObjectInfo.getCurrentModifiedBean() : modifiedObjectInfo.getPreviousModifiedBean());
      String originalExpression=(String)modifiedObjectInfo.getOriginalPropertyBeanValue();
      mapperManager.getUiManager().parseNewExpression(originalExpression,tableEntry,true);
    }
    public void editorValueChanged(    boolean oldValidState,    boolean newValidState){
      if (expressionTextEditor.isFocusControl() || lastExpressionEditorTextWhichLostFocus == expressionTextEditor) {
        ModifiedObjectInfo modifiedObjectInfo=tableViewerCreator.getModifiedObjectInfo();
        ITableEntry tableEntry=(ITableEntry)(modifiedObjectInfo.getCurrentModifiedBean() != null ? modifiedObjectInfo.getCurrentModifiedBean() : modifiedObjectInfo.getPreviousModifiedBean());
        mapperManager.getUiManager().parseNewExpression(text.getText(),tableEntry,false);
        resizeTextEditor(text,tableViewerCreator);
      }
    }
  }
);
  expressionTextEditor.addControlListener(new ControlListener(){
    ExecutionLimiterImproved executionLimiter=null;
    public void controlMoved(    ControlEvent e){
    }
    public void controlResized(    ControlEvent e){
      if (executionLimiter == null) {
        executionLimiter=new ExecutionLimiterImproved(50,true){
          @Override public void execute(          boolean isFinalExecution,          Object data){
            if (isFinalExecution) {
              expressionTextEditor.getDisplay().syncExec(new Runnable(){
                public void run(){
                  if (expressionTextEditor.isDisposed()) {
                    return;
                  }
                  resizeTextEditor(expressionTextEditor,tableViewerCreator);
                }
              }
);
            }
          }
        }
;
      }
      executionLimiter.startIfExecutable();
    }
  }
);
  expressionTextEditor.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent e){
      ITableEntry currentModifiedEntry=(ITableEntry)tableViewerCreator.getModifiedObjectInfo().getCurrentModifiedBean();
      if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.JAVA)) {
        if (currentModifiedEntry instanceof AbstractInOutTableEntry) {
          IMetadataColumn column=((AbstractInOutTableEntry)currentModifiedEntry).getMetadataColumn();
          String typeToGenerate=JavaTypesManager.getTypeToGenerate(column.getTalendType(),column.isNullable());
          cellEditor.setExpressionType(typeToGenerate);
        }
 else         if (currentModifiedEntry instanceof VarTableEntry) {
          boolean nullable=((VarTableEntry)currentModifiedEntry).isNullable();
          String talendType=((VarTableEntry)currentModifiedEntry).getType();
          String typeToGenerate=JavaTypesManager.getTypeToGenerate(talendType,nullable);
          cellEditor.setExpressionType(typeToGenerate);
        }
      }
      initExpressionProposals(cellEditor,zones,tableViewerCreator,currentModifiedEntry);
      resizeTextEditor(expressionTextEditor,tableViewerCreator);
      StyledTextHandler styledTextHandler=mapperManager.getUiManager().getTabFolderEditors().getStyledTextHandler();
      if (styledTextHandler.getCurrentEntry() != currentModifiedEntry) {
        styledTextHandler.setCurrentEntry(currentModifiedEntry);
        styledTextHandler.setTextWithoutNotifyListeners(currentModifiedEntry.getExpression() == null ? "String_Node_Str" : currentModifiedEntry.getExpression());
      }
    }
    public void focusLost(    FocusEvent e){
      expressionEditorTextSelectionBeforeFocusLost=expressionTextEditor.getSelection();
      lastExpressionEditorTextWhichLostFocus=expressionTextEditor;
      checkChangementsAfterEntryModifiedOrAdded(false);
    }
  }
);
  column.setCellEditor(cellEditor,new CellEditorValueAdapter(){
    @Override public Object getCellEditorTypedValue(    CellEditor cellEditor,    Object originalTypedValue){
      return super.getCellEditorTypedValue(cellEditor,originalTypedValue);
    }
    @Override public String getColumnText(    CellEditor cellEditor,    Object bean,    Object cellEditorTypedValue){
      return super.getColumnText(cellEditor,bean,cellEditorTypedValue).replaceAll("String_Node_Str","String_Node_Str");
    }
    @Override public Object getOriginalTypedValue(    CellEditor cellEditor,    Object cellEditorTypedValue){
      return super.getOriginalTypedValue(cellEditor,cellEditorTypedValue);
    }
  }
);
  return cellEditor;
}

Fixed version (ground truth):
protected ExtendedTextCellEditor createExpressionCellEditor(final TableViewerCreator tableViewerCreator,TableViewerCreatorColumn column,final Zone[] zones,boolean isConstraintExpressionCellEditor){
  IService expressionBuilderDialogService=GlobalServiceRegister.getDefault().getService(IExpressionBuilderDialogService.class);
  CellEditorDialogBehavior behavior=new CellEditorDialogBehavior();
  final ExtendedTextCellEditorWithProposal cellEditor=new ExtendedTextCellEditorWithProposal(tableViewerCreator.getTable(),SWT.MULTI | SWT.BORDER,column,behavior){
    @Override public void activate(){
      super.activate();
    }
  }
;
  dialog=((IExpressionBuilderDialogService)expressionBuilderDialogService).getExpressionBuilderInstance(tableViewerCreator.getCompositeParent(),cellEditor,mapperManager.getAbstractMapComponent());
  behavior.setCellEditorDialog(dialog);
  final Text expressionTextEditor=cellEditor.getTextControl();
  if (isConstraintExpressionCellEditor) {
    constraintExpressionTextEditor=expressionTextEditor;
  }
 else {
    columnExpressionTextEditor=expressionTextEditor;
  }
  cellEditor.addListener(new ICellEditorListener(){
    Text text=expressionTextEditor;
    public void applyEditorValue(){
      ModifiedObjectInfo modifiedObjectInfo=tableViewerCreator.getModifiedObjectInfo();
      mapperManager.getUiManager().parseNewExpression(text.getText(),(ITableEntry)modifiedObjectInfo.getCurrentModifiedBean(),true);
    }
    public void cancelEditor(){
      ModifiedObjectInfo modifiedObjectInfo=tableViewerCreator.getModifiedObjectInfo();
      text.setText((String)modifiedObjectInfo.getOriginalPropertyBeanValue());
      ITableEntry tableEntry=(ITableEntry)(modifiedObjectInfo.getCurrentModifiedBean() != null ? modifiedObjectInfo.getCurrentModifiedBean() : modifiedObjectInfo.getPreviousModifiedBean());
      String originalExpression=(String)modifiedObjectInfo.getOriginalPropertyBeanValue();
      mapperManager.getUiManager().parseNewExpression(originalExpression,tableEntry,true);
    }
    public void editorValueChanged(    boolean oldValidState,    boolean newValidState){
      if (expressionTextEditor.isFocusControl() || lastExpressionEditorTextWhichLostFocus == expressionTextEditor) {
        ModifiedObjectInfo modifiedObjectInfo=tableViewerCreator.getModifiedObjectInfo();
        ITableEntry tableEntry=(ITableEntry)(modifiedObjectInfo.getCurrentModifiedBean() != null ? modifiedObjectInfo.getCurrentModifiedBean() : modifiedObjectInfo.getPreviousModifiedBean());
        mapperManager.getUiManager().parseNewExpression(text.getText(),tableEntry,false);
        resizeTextEditor(text,tableViewerCreator);
      }
    }
  }
);
  expressionTextEditor.addControlListener(new ControlListener(){
    ExecutionLimiterImproved executionLimiter=null;
    public void controlMoved(    ControlEvent e){
    }
    public void controlResized(    ControlEvent e){
      if (executionLimiter == null) {
        executionLimiter=new ExecutionLimiterImproved(50,true){
          @Override public void execute(          boolean isFinalExecution,          Object data){
            if (isFinalExecution) {
              expressionTextEditor.getDisplay().syncExec(new Runnable(){
                public void run(){
                  if (expressionTextEditor.isDisposed()) {
                    return;
                  }
                  resizeTextEditor(expressionTextEditor,tableViewerCreator);
                }
              }
);
            }
          }
        }
;
      }
      executionLimiter.startIfExecutable();
    }
  }
);
  expressionTextEditor.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent e){
      ITableEntry currentModifiedEntry=(ITableEntry)tableViewerCreator.getModifiedObjectInfo().getCurrentModifiedBean();
      boolean needInit=false;
      if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.JAVA)) {
        if (currentModifiedEntry instanceof AbstractInOutTableEntry) {
          IMetadataColumn column=((AbstractInOutTableEntry)currentModifiedEntry).getMetadataColumn();
          String typeToGenerate=JavaTypesManager.getTypeToGenerate(column.getTalendType(),column.isNullable());
          cellEditor.setExpressionType(typeToGenerate);
        }
 else         if (currentModifiedEntry instanceof VarTableEntry) {
          boolean nullable=((VarTableEntry)currentModifiedEntry).isNullable();
          String talendType=((VarTableEntry)currentModifiedEntry).getType();
          String typeToGenerate=JavaTypesManager.getTypeToGenerate(talendType,nullable);
          cellEditor.setExpressionType(typeToGenerate);
          if ("String_Node_Str".equals(currentModifiedEntry.getExpression()) || currentModifiedEntry.getExpression() == null) {
            needInit=true;
          }
        }
      }
      if (!needInit) {
        initExpressionProposals(cellEditor,zones,tableViewerCreator,currentModifiedEntry);
      }
      resizeTextEditor(expressionTextEditor,tableViewerCreator);
      StyledTextHandler styledTextHandler=mapperManager.getUiManager().getTabFolderEditors().getStyledTextHandler();
      if (styledTextHandler.getCurrentEntry() != currentModifiedEntry) {
        styledTextHandler.setCurrentEntry(currentModifiedEntry);
        styledTextHandler.setTextWithoutNotifyListeners(currentModifiedEntry.getExpression() == null ? "String_Node_Str" : currentModifiedEntry.getExpression());
      }
    }
    public void focusLost(    FocusEvent e){
      expressionEditorTextSelectionBeforeFocusLost=expressionTextEditor.getSelection();
      lastExpressionEditorTextWhichLostFocus=expressionTextEditor;
      checkChangementsAfterEntryModifiedOrAdded(false);
    }
  }
);
  column.setCellEditor(cellEditor,new CellEditorValueAdapter(){
    @Override public Object getCellEditorTypedValue(    CellEditor cellEditor,    Object originalTypedValue){
      return super.getCellEditorTypedValue(cellEditor,originalTypedValue);
    }
    @Override public String getColumnText(    CellEditor cellEditor,    Object bean,    Object cellEditorTypedValue){
      return super.getColumnText(cellEditor,bean,cellEditorTypedValue).replaceAll("String_Node_Str","String_Node_Str");
    }
    @Override public Object getOriginalTypedValue(    CellEditor cellEditor,    Object cellEditorTypedValue){
      return super.getOriginalTypedValue(cellEditor,cellEditorTypedValue);
    }
  }
);
  return cellEditor;
}