Program: 148886
Project: 148886
Buggy source:
protected Control createDialogArea(Composite parent){
  parent.getShell().setText(this.title);
  Composite composite=(Composite)super.createDialogArea(parent);
  GridLayout layout=(GridLayout)composite.getLayout();
  layout.numColumns=2;
  Label idLabel=new Label(composite,SWT.NONE);
  idLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  idLabel.setText("String_Node_Str");
  if (this.isChanged) {
    idText=new Text(composite,SWT.NONE);
  }
 else {
    idText=new Text(composite,SWT.NONE | SWT.READ_ONLY);
  }
  idText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  ((GridData)idText.getLayoutData()).widthHint=300;
  idText.setDoubleClickEnabled(false);
  Label contextLabel=new Label(composite,SWT.NONE);
  contextLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  contextLabel.setText("String_Node_Str");
  contextText=new Text(composite,SWT.NONE);
  contextText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  contextText.setDoubleClickEnabled(false);
  Label applicationNameLabel=new Label(composite,SWT.NONE);
  applicationNameLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  applicationNameLabel.setText("String_Node_Str");
  applicationNameText=new Text(composite,SWT.NONE);
  applicationNameText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  descriptionsComposite=new Composite(composite,SWT.BORDER);
  descriptionsComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,2,1));
  descriptionsComposite.setLayout(new GridLayout(3,false));
  Label descriptionsLabel=new Label(descriptionsComposite,SWT.NULL);
  descriptionsLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,3,1));
  descriptionsLabel.setText("String_Node_Str");
  languagesCombo=new Combo(descriptionsComposite,SWT.READ_ONLY | SWT.DROP_DOWN | SWT.SINGLE);
  languagesCombo.setLayoutData(new GridData(SWT.BEGINNING,SWT.NONE,false,false,1,1));
  Set<String> languages=Util.lang2iso.keySet();
  for (Iterator iter=languages.iterator(); iter.hasNext(); ) {
    String language=(String)iter.next();
    languagesCombo.add(language);
  }
  languagesCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
    }
  }
);
  languagesCombo.select(0);
  labelText=new Text(descriptionsComposite,SWT.BORDER | SWT.SINGLE);
  labelText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  labelText.addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
    }
    public void keyReleased(    KeyEvent e){
      if ((e.stateMask == 0) && (e.character == SWT.CR)) {
        String isoCode=Util.lang2iso.get(languagesCombo.getText());
        descriptionsMap.put(isoCode,labelText.getText());
        descriptionsViewer.refresh();
      }
    }
  }
);
  Button addLabelButton=new Button(descriptionsComposite,SWT.PUSH);
  addLabelButton.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true,1,1));
  addLabelButton.setImage(ImageCache.getCreatedImage(EImage.ADD_OBJ.getPath()));
  addLabelButton.setToolTipText("String_Node_Str");
  addLabelButton.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    org.eclipse.swt.events.SelectionEvent e){
    }
    public void widgetSelected(    org.eclipse.swt.events.SelectionEvent e){
      String isoCode=Util.lang2iso.get(languagesCombo.getText());
      descriptionsMap.put(isoCode,labelText.getText());
      descriptionsViewer.refresh();
    }
  }
);
  final String LANGUAGE="String_Node_Str";
  final String LABEL="String_Node_Str";
  descriptionsViewer=new TableViewer(descriptionsComposite,SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL| SWT.BORDER| SWT.FULL_SELECTION);
  descriptionsViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,3,1));
  ((GridData)descriptionsViewer.getControl().getLayoutData()).heightHint=100;
  Table table=descriptionsViewer.getTable();
  new TableColumn(table,SWT.LEFT).setText(LANGUAGE);
  new TableColumn(table,SWT.CENTER).setText(LABEL);
  table.getColumn(0).setWidth(150);
  table.getColumn(1).setWidth(150);
  for (int i=2, n=table.getColumnCount(); i < n; i++) {
    table.getColumn(i).pack();
  }
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  CellEditor[] editors=new CellEditor[2];
  editors[0]=new TextCellEditor(table);
  editors[1]=new TextCellEditor(table);
  descriptionsViewer.setCellEditors(editors);
  descriptionsViewer.setContentProvider(new IStructuredContentProvider(){
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
    public Object[] getElements(    Object inputElement){
      LinkedHashMap<String,String> descs=(LinkedHashMap<String,String>)inputElement;
      Set<String> languages=descs.keySet();
      ArrayList<DescriptionLine> lines=new ArrayList<DescriptionLine>();
      for (Iterator iter=languages.iterator(); iter.hasNext(); ) {
        String language=(String)iter.next();
        DescriptionLine line=new DescriptionLine(Util.iso2lang.get(language),descs.get(language));
        lines.add(line);
      }
      return lines.toArray(new DescriptionLine[lines.size()]);
    }
  }
);
  descriptionsViewer.setLabelProvider(new ITableLabelProvider(){
    public boolean isLabelProperty(    Object element,    String property){
      return false;
    }
    public void dispose(){
    }
    public void addListener(    ILabelProviderListener listener){
    }
    public void removeListener(    ILabelProviderListener listener){
    }
    public String getColumnText(    Object element,    int columnIndex){
      DescriptionLine line=(DescriptionLine)element;
switch (columnIndex) {
case 0:
        return line.getLanguage();
case 1:
      return line.getLabel();
  }
  return "String_Node_Str";
}
public Image getColumnImage(Object element,int columnIndex){
  return null;
}
}
);
descriptionsViewer.setColumnProperties(new String[]{LANGUAGE,LABEL});
descriptionsViewer.setCellModifier(new ICellModifier(){
public boolean canModify(Object element,String property){
  return false;
}
public void modify(Object element,String property,Object value){
}
public Object getValue(Object element,String property){
  DescriptionLine line=(DescriptionLine)element;
  if (LANGUAGE.equals(property)) {
    return line.getLanguage();
  }
  if (LABEL.equals(property)) {
    return line.getLabel();
  }
  return null;
}
}
);
descriptionsViewer.addSelectionChangedListener(new ISelectionChangedListener(){
public void selectionChanged(SelectionChangedEvent event){
}
}
);
descriptionsViewer.getTable().addKeyListener(new KeyListener(){
public void keyPressed(KeyEvent e){
}
public void keyReleased(KeyEvent e){
  if ((e.stateMask == 0) && (e.character == SWT.DEL) && (descriptionsViewer.getSelection() != null)) {
    DescriptionLine line=(DescriptionLine)((IStructuredSelection)descriptionsViewer.getSelection()).getFirstElement();
    String isoCode=Util.lang2iso.get(line.getLanguage());
    LinkedHashMap<String,String> descs=(LinkedHashMap<String,String>)descriptionsViewer.getInput();
    descs.remove(isoCode);
    descriptionsViewer.refresh();
  }
}
}
);
descriptionsViewer.refresh();
if (wsMenuEntry != null) {
idText.setText(wsMenuEntry.getId() == null ? "String_Node_Str" : wsMenuEntry.getId());
contextText.setText(wsMenuEntry.getContext() == null ? "String_Node_Str" : wsMenuEntry.getContext());
applicationNameText.setText(wsMenuEntry.getApplication() == null ? "String_Node_Str" : wsMenuEntry.getApplication());
descriptionsViewer.setInput(descriptionsMap);
}
idText.setFocus();
return composite;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  parent.getShell().setText(this.title);
  Composite composite=(Composite)super.createDialogArea(parent);
  GridLayout layout=(GridLayout)composite.getLayout();
  layout.numColumns=2;
  Label idLabel=new Label(composite,SWT.NONE);
  idLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  idLabel.setText("String_Node_Str");
  if (this.isChanged) {
    idText=new Text(composite,SWT.NONE);
  }
 else {
    idText=new Text(composite,SWT.NONE | SWT.READ_ONLY);
  }
  idText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,2,1));
  ((GridData)idText.getLayoutData()).widthHint=300;
  idText.setDoubleClickEnabled(false);
  Label contextLabel=new Label(composite,SWT.NONE);
  contextLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  contextLabel.setText("String_Node_Str");
  contextText=new Text(composite,SWT.NONE);
  contextText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,2,1));
  contextText.setDoubleClickEnabled(false);
  Label applicationNameLabel=new Label(composite,SWT.NONE);
  applicationNameLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  applicationNameLabel.setText("String_Node_Str");
  applicationNameText=new Text(composite,SWT.NONE);
  applicationNameText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,2,1));
  Label iconPathLabel=new Label(composite,SWT.NONE);
  iconPathLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  iconPathLabel.setText("String_Node_Str");
  iconPathText=new FileSelectWidget(composite,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},"String_Node_Str",true);
  descriptionsComposite=new Composite(composite,SWT.BORDER);
  descriptionsComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,3,1));
  descriptionsComposite.setLayout(new GridLayout(3,false));
  Label descriptionsLabel=new Label(descriptionsComposite,SWT.NULL);
  descriptionsLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,3,1));
  descriptionsLabel.setText("String_Node_Str");
  languagesCombo=new Combo(descriptionsComposite,SWT.READ_ONLY | SWT.DROP_DOWN | SWT.SINGLE);
  languagesCombo.setLayoutData(new GridData(SWT.BEGINNING,SWT.NONE,false,false,1,1));
  Set<String> languages=Util.lang2iso.keySet();
  for (Iterator iter=languages.iterator(); iter.hasNext(); ) {
    String language=(String)iter.next();
    languagesCombo.add(language);
  }
  languagesCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
    }
  }
);
  languagesCombo.select(0);
  labelText=new Text(descriptionsComposite,SWT.BORDER | SWT.SINGLE);
  labelText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  labelText.addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
    }
    public void keyReleased(    KeyEvent e){
      if ((e.stateMask == 0) && (e.character == SWT.CR)) {
        String isoCode=Util.lang2iso.get(languagesCombo.getText());
        descriptionsMap.put(isoCode,labelText.getText());
        descriptionsViewer.refresh();
      }
    }
  }
);
  Button addLabelButton=new Button(descriptionsComposite,SWT.PUSH);
  addLabelButton.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true,1,1));
  addLabelButton.setImage(ImageCache.getCreatedImage(EImage.ADD_OBJ.getPath()));
  addLabelButton.setToolTipText("String_Node_Str");
  addLabelButton.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    org.eclipse.swt.events.SelectionEvent e){
    }
    public void widgetSelected(    org.eclipse.swt.events.SelectionEvent e){
      String isoCode=Util.lang2iso.get(languagesCombo.getText());
      descriptionsMap.put(isoCode,labelText.getText());
      descriptionsViewer.refresh();
    }
  }
);
  final String LANGUAGE="String_Node_Str";
  final String LABEL="String_Node_Str";
  descriptionsViewer=new TableViewer(descriptionsComposite,SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL| SWT.BORDER| SWT.FULL_SELECTION);
  descriptionsViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,3,1));
  ((GridData)descriptionsViewer.getControl().getLayoutData()).heightHint=100;
  Table table=descriptionsViewer.getTable();
  new TableColumn(table,SWT.LEFT).setText(LANGUAGE);
  new TableColumn(table,SWT.CENTER).setText(LABEL);
  table.getColumn(0).setWidth(150);
  table.getColumn(1).setWidth(150);
  for (int i=2, n=table.getColumnCount(); i < n; i++) {
    table.getColumn(i).pack();
  }
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  CellEditor[] editors=new CellEditor[2];
  editors[0]=new TextCellEditor(table);
  editors[1]=new TextCellEditor(table);
  descriptionsViewer.setCellEditors(editors);
  descriptionsViewer.setContentProvider(new IStructuredContentProvider(){
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
    public Object[] getElements(    Object inputElement){
      LinkedHashMap<String,String> descs=(LinkedHashMap<String,String>)inputElement;
      Set<String> languages=descs.keySet();
      ArrayList<DescriptionLine> lines=new ArrayList<DescriptionLine>();
      for (Iterator iter=languages.iterator(); iter.hasNext(); ) {
        String language=(String)iter.next();
        DescriptionLine line=new DescriptionLine(Util.iso2lang.get(language),descs.get(language));
        lines.add(line);
      }
      return lines.toArray(new DescriptionLine[lines.size()]);
    }
  }
);
  descriptionsViewer.setLabelProvider(new ITableLabelProvider(){
    public boolean isLabelProperty(    Object element,    String property){
      return false;
    }
    public void dispose(){
    }
    public void addListener(    ILabelProviderListener listener){
    }
    public void removeListener(    ILabelProviderListener listener){
    }
    public String getColumnText(    Object element,    int columnIndex){
      DescriptionLine line=(DescriptionLine)element;
switch (columnIndex) {
case 0:
        return line.getLanguage();
case 1:
      return line.getLabel();
  }
  return "String_Node_Str";
}
public Image getColumnImage(Object element,int columnIndex){
  return null;
}
}
);
descriptionsViewer.setColumnProperties(new String[]{LANGUAGE,LABEL});
descriptionsViewer.setCellModifier(new ICellModifier(){
public boolean canModify(Object element,String property){
  return false;
}
public void modify(Object element,String property,Object value){
}
public Object getValue(Object element,String property){
  DescriptionLine line=(DescriptionLine)element;
  if (LANGUAGE.equals(property)) {
    return line.getLanguage();
  }
  if (LABEL.equals(property)) {
    return line.getLabel();
  }
  return null;
}
}
);
descriptionsViewer.addSelectionChangedListener(new ISelectionChangedListener(){
public void selectionChanged(SelectionChangedEvent event){
}
}
);
descriptionsViewer.getTable().addKeyListener(new KeyListener(){
public void keyPressed(KeyEvent e){
}
public void keyReleased(KeyEvent e){
  if ((e.stateMask == 0) && (e.character == SWT.DEL) && (descriptionsViewer.getSelection() != null)) {
    DescriptionLine line=(DescriptionLine)((IStructuredSelection)descriptionsViewer.getSelection()).getFirstElement();
    String isoCode=Util.lang2iso.get(line.getLanguage());
    LinkedHashMap<String,String> descs=(LinkedHashMap<String,String>)descriptionsViewer.getInput();
    descs.remove(isoCode);
    descriptionsViewer.refresh();
  }
}
}
);
descriptionsViewer.refresh();
if (wsMenuEntry != null) {
idText.setText(wsMenuEntry.getId() == null ? "String_Node_Str" : wsMenuEntry.getId());
contextText.setText(wsMenuEntry.getContext() == null ? "String_Node_Str" : wsMenuEntry.getContext());
applicationNameText.setText(wsMenuEntry.getApplication() == null ? "String_Node_Str" : wsMenuEntry.getApplication());
iconPathText.setFilename(wsMenuEntry.getIcon() == null ? "String_Node_Str" : wsMenuEntry.getIcon());
descriptionsViewer.setInput(descriptionsMap);
}
idText.setFocus();
return composite;
}