Program: 107935
Project: 107935
Buggy source:
/** 
 * Updates the controls
 */
private void updateControls(){
  DataDefinition definition=model.getInputDefinition();
  List<String> qis=new ArrayList<String>();
  if (definition != null) {
    Set<String> _qis=definition.getQuasiIdentifyingAttributes();
    if (this.attributes.equals(_qis)) {
      return;
    }
    DataHandle handle=model.getInputConfig().getInput().getHandle();
    for (int i=0; i < handle.getNumColumns(); i++) {
      String attr=handle.getAttributeName(i);
      if (_qis.contains(attr)) {
        qis.add(attr);
      }
    }
    attributes.clear();
    attributes.addAll(qis);
  }
  if (root.isDisposed())   return;
  root.setRedraw(false);
  if (panel != null) {
    panel.dispose();
  }
  panel=new Composite(root,SWT.NONE);
  panel.setLayoutData(GridDataFactory.swtDefaults().grab(true,true).align(SWT.FILL,SWT.CENTER).create());
  panel.setLayout(GridLayoutFactory.swtDefaults().numColumns(qis.size()).margins(0,0).equalWidth(true).create());
  List<Composite> composites=new ArrayList<Composite>();
  for (int i=0; i < qis.size(); i++) {
    Composite c=new Composite(panel,SWT.NONE);
    c.setLayoutData(GridDataFactory.fillDefaults().grab(true,true).align(SWT.FILL,SWT.CENTER).create());
    c.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).margins(2,0).create());
    composites.add(c);
  }
  for (int i=0; i < qis.size(); i++) {
    Label label=new Label(composites.get(i),SWT.CENTER);
    label.setText(qis.get(i));
    label.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,1,1));
  }
  List<Knob<Double>> knobs=new ArrayList<Knob<Double>>();
  for (int i=0; i < qis.size(); i++) {
    Knob<Double> knob=new Knob<Double>(composites.get(i),SWT.NULL,new KnobRange.Double(0d,1d));
    knob.setLayoutData(GridDataFactory.swtDefaults().grab(false,false).align(SWT.CENTER,SWT.CENTER).hint(MIN_KNOB,MIN_KNOB).create());
    knob.setDefaultColorProfile(defaultColorProfile);
    knob.setFocusedColorProfile(focusedColorProfile);
    knobs.add(knob);
  }
  for (int i=0; i < qis.size(); i++) {
    final Label label=new Label(composites.get(i),SWT.CENTER);
    label.setText("String_Node_Str");
    label.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,1,1));
    final String attribute=qis.get(i);
    final Knob<Double> knob=knobs.get(i);
    knob.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent arg0){
        double value=knob.getValue();
        label.setText(SWTUtil.getPrettyString(value));
        label.setToolTipText(String.valueOf(value));
        try {
          double parsedValue=Double.valueOf(SWTUtil.getPrettyString(value)).doubleValue();
          if (parsedValue == 0d && value > 0d) {
            label.setText("String_Node_Str");
          }
          if (parsedValue == 1d && value < 1d) {
            label.setText("String_Node_Str");
          }
        }
 catch (        Exception e) {
        }
        if (model != null && model.getInputConfig() != null) {
          model.getInputConfig().setAttributeWeight(attribute,value);
        }
      }
    }
);
  }
  for (int i=0; i < qis.size(); i++) {
    if (model != null && model.getInputConfig() != null) {
      knobs.get(i).setValue(model.getInputConfig().getAttributeWeight(qis.get(i)));
    }
  }
  root.setContent(panel);
  root.setMinWidth(MIN_SPACE * qis.size());
  root.setExpandHorizontal(true);
  root.setExpandVertical(true);
  root.setVisible(!qis.isEmpty());
  root.layout(true,true);
  root.setRedraw(true);
}

Fixed version (ground truth):
/** 
 * Updates the controls
 */
private void updateControls(){
  DataDefinition definition=model.getInputDefinition();
  List<String> qis=new ArrayList<String>();
  if (definition != null) {
    Set<String> _qis=definition.getQuasiIdentifyingAttributes();
    if (this.attributes.equals(_qis)) {
      return;
    }
    DataHandle handle=model.getInputConfig().getInput().getHandle();
    for (int i=0; i < handle.getNumColumns(); i++) {
      String attr=handle.getAttributeName(i);
      if (_qis.contains(attr)) {
        qis.add(attr);
      }
    }
    attributes.clear();
    attributes.addAll(qis);
  }
  if (root.isDisposed())   return;
  root.setRedraw(false);
  if (panel != null) {
    panel.dispose();
  }
  panel=new Composite(root,SWT.NONE);
  panel.setLayoutData(GridDataFactory.swtDefaults().grab(true,true).align(SWT.FILL,SWT.CENTER).create());
  panel.setLayout(GridLayoutFactory.swtDefaults().numColumns(qis.size()).margins(0,0).equalWidth(true).create());
  List<Composite> composites=new ArrayList<Composite>();
  for (int i=0; i < qis.size(); i++) {
    Composite c=new Composite(panel,SWT.NONE);
    c.setLayoutData(GridDataFactory.fillDefaults().grab(true,true).align(SWT.FILL,SWT.CENTER).create());
    c.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).margins(2,0).create());
    composites.add(c);
  }
  for (int i=0; i < qis.size(); i++) {
    Label label=new Label(composites.get(i),SWT.CENTER);
    label.setText(qis.get(i));
    label.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,1,1));
  }
  List<Knob<Double>> knobs=new ArrayList<Knob<Double>>();
  for (int i=0; i < qis.size(); i++) {
    Knob<Double> knob=new Knob<Double>(composites.get(i),SWT.NULL,new KnobRange.Double(0d,1d));
    knob.setLayoutData(GridDataFactory.swtDefaults().grab(false,false).align(SWT.CENTER,SWT.CENTER).hint(MIN_KNOB,MIN_KNOB).create());
    knob.setDefaultColorProfile(defaultColorProfile);
    knob.setFocusedColorProfile(focusedColorProfile);
    knobs.add(knob);
  }
  for (int i=0; i < qis.size(); i++) {
    final Label label=new Label(composites.get(i),SWT.CENTER);
    label.setText("String_Node_Str");
    label.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,1,1));
    final String attribute=qis.get(i);
    final Knob<Double> knob=knobs.get(i);
    knob.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent arg0){
        double value=knob.getValue();
        label.setText(SWTUtil.getPrettyString(value));
        label.setToolTipText(String.valueOf(value));
        try {
          double parsedValue=Double.valueOf(SWTUtil.getPrettyString(value)).doubleValue();
          if (parsedValue == 0d && value > 0d) {
            label.setText("String_Node_Str");
          }
          if (parsedValue == 1d && value < 1d) {
            label.setText("String_Node_Str");
          }
        }
 catch (        Exception e) {
        }
        if (model != null && model.getInputConfig() != null) {
          model.getInputConfig().setAttributeWeight(attribute,value);
        }
      }
    }
);
    knob.addSelectionListener(new DelayedChangeListener(100){
      @Override public void delayedEvent(){
        controller.update(new ModelEvent(ViewAttributeWeights.this,ModelPart.ATTRIBUTE_WEIGHT,model.getInputConfig().getAttributeWeight(attribute)));
      }
    }
);
  }
  for (int i=0; i < qis.size(); i++) {
    if (model != null && model.getInputConfig() != null) {
      knobs.get(i).setValue(model.getInputConfig().getAttributeWeight(qis.get(i)));
    }
  }
  root.setContent(panel);
  root.setMinWidth(MIN_SPACE * qis.size());
  root.setExpandHorizontal(true);
  root.setExpandVertical(true);
  root.setVisible(!qis.isEmpty());
  root.layout(true,true);
  root.setRedraw(true);
}