Program: 76694
Project: 76694
Buggy source:
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();
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  SessionHandleAdapter.getInstance().getCommandStack().startTrans(Messages.getString("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();
}