Program: 76723
Project: 76723
Buggy source:
public void widgetSelected(SelectionEvent e){
  if (((Button)e.widget).getSelection()) {
    for (int i=0; i < toggleProviders.length; i++) {
      BorderInfomation information=new BorderInfomation();
      information.setPosition(toggleProviders[i].getPosition());
      information.setColor(builder.getRGB());
      information.setStyle((String)styleCombo.getSelectedItem());
      information.setWidth((String)widthCombo.getSelectedItem());
      previewCanvas.setBorderInfomation(information);
      toggles[i].setSelection(true);
      try {
        toggleProviders[i].save(information);
      }
 catch (      Exception e1) {
        ExceptionHandler.handle(e1);
      }
    }
    restoreButton=toggles[toggleProviders.length - 1];
  }
 else {
    for (int i=0; i < toggleProviders.length; i++) {
      previewCanvas.removeBorderInfomation(toggleProviders[i].getPosition());
      toggles[i].setSelection(false);
      try {
        toggleProviders[i].reset();
      }
 catch (      Exception e1) {
        ExceptionHandler.handle(e1);
      }
    }
    restoreButton=null;
  }
  previewCanvas.redraw();
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  SessionHandleAdapter.getInstance().getCommandStack().startTrans("String_Node_Str");
  if (((Button)e.widget).getSelection()) {
    for (int i=0; i < toggleProviders.length; i++) {
      BorderInfomation information=new BorderInfomation();
      information.setPosition(toggleProviders[i].getPosition());
      information.setColor(builder.getRGB());
      information.setStyle((String)styleCombo.getSelectedItem());
      information.setWidth((String)widthCombo.getSelectedItem());
      toggles[i].setSelection(true);
      previewCanvas.setBorderInfomation(information);
      try {
        toggleProviders[i].save(information);
      }
 catch (      Exception e1) {
        ExceptionHandler.handle(e1);
      }
    }
    restoreInfo=(BorderInfomation)toggleProviders[toggleProviders.length - 1].load();
  }
 else {
    boolean reset=true;
    for (int i=0; i < toggleProviders.length; i++) {
      BorderInfomation info=(BorderInfomation)toggleProviders[i].load();
      if (!(info.getStyle().equals((String)styleCombo.getSelectedItem())) || !(info.getColor().equals(builder.getRGB())) || !(info.getWidth().equals((String)widthCombo.getSelectedItem()))) {
        reset=false;
        break;
      }
    }
    if (reset) {
      for (int i=0; i < toggleProviders.length; i++) {
        previewCanvas.removeBorderInfomation(toggleProviders[i].getPosition());
        toggles[i].setSelection(false);
        try {
          toggleProviders[i].reset();
        }
 catch (        Exception e1) {
          ExceptionHandler.handle(e1);
        }
      }
    }
 else {
      for (int i=0; i < toggleProviders.length; i++) {
        BorderInfomation information=new BorderInfomation();
        information.setPosition(toggleProviders[i].getPosition());
        information.setColor(builder.getRGB());
        information.setStyle((String)styleCombo.getSelectedItem());
        information.setWidth((String)widthCombo.getSelectedItem());
        previewCanvas.setBorderInfomation(information);
        restoreInfo=information;
        try {
          toggleProviders[i].save(information);
        }
 catch (        Exception e1) {
          ExceptionHandler.handle(e1);
        }
      }
      ((Button)e.widget).setSelection(true);
    }
  }
  previewCanvas.redraw();
  SessionHandleAdapter.getInstance().getCommandStack().commit();
}