Program: 126976
Project: 126976
Buggy source:
/** 
 * Main Fields addControls.
 */
@Override protected void addFieldsListeners(){
  scrolledCompositeFileViewer.getHorizontalBar().addListener(SWT.Selection,new Listener(){
    public void handleEvent(    Event e){
      int hSelection=scrolledCompositeFileViewer.getHorizontalBar().getSelection();
      graphicRule.setBounds(5 - hSelection,5,filePositionalViewer.getText().getSize().x,graphicRule.getSize().y);
    }
  }
);
  scrolledCompositeFileViewer.addControlListener(new ControlListener(){
    public void controlMoved(    ControlEvent e){
    }
    public void controlResized(    ControlEvent e){
      int compositeXsize=filePositionalViewer.getText().getSize().x;
      int compositeYsize=graphicRule.getSize().y;
      if (compositeXsize <= 10000) {
        graphicRule.setBounds(5,5,500,0);
        graphicRule.setSize(10000,compositeYsize);
      }
 else {
        graphicRule.setBounds(5,5,500,0);
        graphicRule.setSize(compositeXsize,compositeYsize);
      }
    }
  }
);
  serverCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      getConnection().setServer(serverCombo.getText());
      checkFieldsValue();
    }
  }
);
  fileField.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        getConnection().setFilePath(PathUtils.getPortablePath(fileField.getText()));
        checkFilePathAndManageIt(true);
      }
    }
  }
);
  encodingCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      getConnection().setEncoding(encodingCombo.getText());
      checkFilePathAndManageIt(true);
    }
  }
);
  fileFormatCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      getConnection().setFormat(FileFormat.getByName(fileFormatCombo.getText()));
      if (getConnection().getRowSeparatorType() == RowSeparator.STANDART_EOL_LITERAL) {
        if (getConnection().getFormat().toString().equals(FileFormat.MAC_LITERAL.getName())) {
          getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
        }
 else {
          getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
        }
      }
      checkFilePathAndManageIt(false);
    }
  }
);
  filePositionalViewer.getFieldSeparatorValue().addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (!isContextMode()) {
        String value=filePositionalViewer.getFieldSeparatorValue().getText();
        String valueToField=value;
        if (fieldSeparatorText.getText().contains("String_Node_Str")) {
          if (value.equals("String_Node_Str")) {
            valueToField="String_Node_Str";
          }
 else {
            valueToField=value + "String_Node_Str";
          }
        }
        if (!fieldSeparatorText.getText().equals(valueToField)) {
          fieldSeparatorText.setEditable(false);
          fieldSeparatorText.setText(valueToField);
          fieldSeparatorText.setEditable(true);
          fieldPositionText.setEditable(false);
          fieldPositionText.setText(filePositionalViewer.calculatePositionX());
          fieldPositionText.setEditable(true);
          checkFieldsValue();
        }
      }
    }
  }
);
  fieldSeparatorText.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        String separatorValue=TalendQuoteUtils.addQuotes(fieldSeparatorText.getText());
        getConnection().setFieldSeparatorValue(separatorValue);
        if (fieldSeparatorText.getEditable() && getConnection().getFieldSeparatorValue().equals(separatorValue)) {
          if (!checkFieldSeparatorValue()) {
            fieldPositionText.setEditable(false);
            if (filePositionalViewer.getVisible()) {
              filePositionalViewer.cleanAllMarkers();
              filePositionalViewer.setEnabled(false);
              graphicRule.setEnabled(false);
            }
          }
 else {
            String value=getValidateFieldSeparator(separatorValue);
            Point selection=fieldSeparatorText.getSelection();
            if ((!value.equals(TalendQuoteUtils.removeQuotes(getConnection().getFieldSeparatorValue())))) {
              fieldPositionText.setEditable(false);
              if (filePositionalViewer.getVisible()) {
                filePositionalViewer.setEnabled(false);
                graphicRule.setEnabled(false);
                filePositionalViewer.cleanAllMarkers();
              }
            }
 else {
              filePositionalViewer.setEnabled(true);
              graphicRule.setEnabled(true);
              filePositionalViewer.setSeparatorValue(value,filePositionalViewer.getVisible());
              String newPosition=filePositionalViewer.calculatePositionX();
              if (!fieldPositionText.getText().equals(newPosition)) {
                fieldPositionText.setEditable(false);
                fieldPositionText.setText(newPosition);
              }
              fieldPositionText.setEditable(true);
            }
            fieldSeparatorText.setSelection(selection.x);
          }
        }
      }
    }
  }
);
  fieldSeparatorText.addKeyListener(new KeyAdapter(){
    @Override public void keyPressed(    KeyEvent e){
      if (isContextMode()) {
        e.doit=false;
      }
 else {
        e.doit=charIsAcceptedOnFieldSeparator(fieldSeparatorText.getText(),e.character,fieldSeparatorText.getSelection().x);
      }
    }
  }
);
  fieldPositionText.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (fieldPositionText.getEditable()) {
          if (!checkFieldPositionValue()) {
            fieldSeparatorText.setEditable(false);
            if (filePositionalViewer.getVisible()) {
              filePositionalViewer.setEnabled(false);
              graphicRule.setEnabled(false);
              filePositionalViewer.cleanAllMarkers();
            }
          }
 else {
            filePositionalViewer.setEnabled(true);
            graphicRule.setEnabled(true);
            String value=getValidateFieldPosition(fieldPositionText.getText());
            Point selection=fieldPositionText.getSelection();
            filePositionalViewer.setPositionValue(value,filePositionalViewer.getVisible());
            fieldSeparatorText.setEditable(true);
            value=filePositionalViewer.getSeparatorValue();
            if (fieldSeparatorText.getText().equals("String_Node_Str")) {
              fieldSeparatorText.setText("String_Node_Str");
            }
 else             if (fieldSeparatorText.getText().contains("String_Node_Str")) {
              fieldSeparatorText.setText(value + "String_Node_Str");
            }
 else {
              fieldSeparatorText.setText(value);
            }
            fieldPositionText.setSelection(selection.x);
          }
        }
      }
    }
  }
);
  fieldPositionText.addKeyListener(new KeyAdapter(){
    @Override public void keyPressed(    KeyEvent e){
      if (isContextMode()) {
        e.doit=false;
      }
 else {
        e.doit=charIsAcceptedOnFieldPosition(fieldPositionText.getText(),e.character,fieldPositionText.getSelection().x);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Main Fields addControls.
 */
@Override protected void addFieldsListeners(){
  scrolledCompositeFileViewer.getHorizontalBar().addListener(SWT.Selection,new Listener(){
    public void handleEvent(    Event e){
      int hSelection=scrolledCompositeFileViewer.getHorizontalBar().getSelection();
      graphicRule.setBounds(5 - hSelection,5,filePositionalViewer.getText().getSize().x,graphicRule.getSize().y);
    }
  }
);
  scrolledCompositeFileViewer.addControlListener(new ControlListener(){
    public void controlMoved(    ControlEvent e){
    }
    public void controlResized(    ControlEvent e){
      int compositeXsize=filePositionalViewer.getText().getSize().x;
      int compositeYsize=graphicRule.getSize().y;
      if (compositeXsize <= 10000) {
        graphicRule.setBounds(5,5,500,0);
        graphicRule.setSize(10000,compositeYsize);
      }
 else {
        graphicRule.setBounds(5,5,500,0);
        graphicRule.setSize(compositeXsize,compositeYsize);
      }
    }
  }
);
  serverCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      getConnection().setServer(serverCombo.getText());
      checkFieldsValue();
    }
  }
);
  fileField.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        getConnection().setFilePath(PathUtils.getPortablePath(fileField.getText()));
        checkFilePathAndManageIt(true);
      }
    }
  }
);
  encodingCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      getConnection().setEncoding(encodingCombo.getText());
      checkFilePathAndManageIt(false);
    }
  }
);
  fileFormatCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      getConnection().setFormat(FileFormat.getByName(fileFormatCombo.getText()));
      if (getConnection().getRowSeparatorType() == RowSeparator.STANDART_EOL_LITERAL) {
        if (getConnection().getFormat().toString().equals(FileFormat.MAC_LITERAL.getName())) {
          getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
        }
 else {
          getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
        }
      }
      checkFilePathAndManageIt(false);
    }
  }
);
  filePositionalViewer.getFieldSeparatorValue().addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (!isContextMode()) {
        String value=filePositionalViewer.getFieldSeparatorValue().getText();
        String valueToField=value;
        if (fieldSeparatorText.getText().contains("String_Node_Str")) {
          if (value.equals("String_Node_Str")) {
            valueToField="String_Node_Str";
          }
 else {
            valueToField=value + "String_Node_Str";
          }
        }
        if (!fieldSeparatorText.getText().equals(valueToField)) {
          fieldSeparatorText.setEditable(false);
          fieldSeparatorText.setText(valueToField);
          fieldSeparatorText.setEditable(true);
          fieldPositionText.setEditable(false);
          fieldPositionText.setText(filePositionalViewer.calculatePositionX());
          fieldPositionText.setEditable(true);
          checkFieldsValue();
        }
      }
    }
  }
);
  fieldSeparatorText.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        String separatorValue=TalendQuoteUtils.addQuotes(fieldSeparatorText.getText());
        getConnection().setFieldSeparatorValue(separatorValue);
        if (fieldSeparatorText.getEditable() && getConnection().getFieldSeparatorValue().equals(separatorValue)) {
          if (!checkFieldSeparatorValue()) {
            fieldPositionText.setEditable(false);
            if (filePositionalViewer.getVisible()) {
              filePositionalViewer.cleanAllMarkers();
              filePositionalViewer.setEnabled(false);
              graphicRule.setEnabled(false);
            }
          }
 else {
            String value=getValidateFieldSeparator(separatorValue);
            Point selection=fieldSeparatorText.getSelection();
            if ((!value.equals(TalendQuoteUtils.removeQuotes(getConnection().getFieldSeparatorValue())))) {
              fieldPositionText.setEditable(false);
              if (filePositionalViewer.getVisible()) {
                filePositionalViewer.setEnabled(false);
                graphicRule.setEnabled(false);
                filePositionalViewer.cleanAllMarkers();
              }
            }
 else {
              filePositionalViewer.setEnabled(true);
              graphicRule.setEnabled(true);
              filePositionalViewer.setSeparatorValue(value,filePositionalViewer.getVisible());
              String newPosition=filePositionalViewer.calculatePositionX();
              if (!fieldPositionText.getText().equals(newPosition)) {
                fieldPositionText.setEditable(false);
                fieldPositionText.setText(newPosition);
              }
              fieldPositionText.setEditable(true);
            }
            fieldSeparatorText.setSelection(selection.x);
          }
        }
      }
    }
  }
);
  fieldSeparatorText.addKeyListener(new KeyAdapter(){
    @Override public void keyPressed(    KeyEvent e){
      if (isContextMode()) {
        e.doit=false;
      }
 else {
        e.doit=charIsAcceptedOnFieldSeparator(fieldSeparatorText.getText(),e.character,fieldSeparatorText.getSelection().x);
      }
    }
  }
);
  fieldPositionText.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        if (fieldPositionText.getEditable()) {
          if (!checkFieldPositionValue()) {
            fieldSeparatorText.setEditable(false);
            if (filePositionalViewer.getVisible()) {
              filePositionalViewer.setEnabled(false);
              graphicRule.setEnabled(false);
              filePositionalViewer.cleanAllMarkers();
            }
          }
 else {
            filePositionalViewer.setEnabled(true);
            graphicRule.setEnabled(true);
            String value=getValidateFieldPosition(fieldPositionText.getText());
            Point selection=fieldPositionText.getSelection();
            filePositionalViewer.setPositionValue(value,filePositionalViewer.getVisible());
            fieldSeparatorText.setEditable(true);
            value=filePositionalViewer.getSeparatorValue();
            if (fieldSeparatorText.getText().equals("String_Node_Str")) {
              fieldSeparatorText.setText("String_Node_Str");
            }
 else             if (fieldSeparatorText.getText().contains("String_Node_Str")) {
              fieldSeparatorText.setText(value + "String_Node_Str");
            }
 else {
              fieldSeparatorText.setText(value);
            }
            fieldPositionText.setSelection(selection.x);
          }
        }
      }
    }
  }
);
  fieldPositionText.addKeyListener(new KeyAdapter(){
    @Override public void keyPressed(    KeyEvent e){
      if (isContextMode()) {
        e.doit=false;
      }
 else {
        e.doit=charIsAcceptedOnFieldPosition(fieldPositionText.getText(),e.character,fieldPositionText.getSelection().x);
      }
    }
  }
);
}