Program: 148175
Project: 148175
Buggy source:
public IStatus doAction(){
  try {
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDComponent xSDCom=null;
    if (selection.getFirstElement() instanceof XSDSimpleTypeDefinition)     std=(XSDSimpleTypeDefinition)selection.getFirstElement();
 else {
      TreePath tPath=((TreeSelection)selection).getPaths()[0];
      for (int i=0; i < tPath.getSegmentCount(); i++) {
        if (tPath.getSegment(i) instanceof XSDSimpleTypeDefinition)         std=(XSDSimpleTypeDefinition)(tPath.getSegment(i));
      }
    }
    if (facetName.equals("String_Node_Str")) {
      editPattern();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editEnumeration();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editLength();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMinLength();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMaxLength();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editTotalDigits();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editFractionDigits();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMaxInclusive();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMaxExclusive();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMinInclusive();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMinExclusive();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editWhiteSpace();
    }
 else {
      MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + facetName);
      return Status.CANCEL_STATUS;
    }
    std.updateElement();
    page.refresh();
    page.markDirty();
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    return Status.CANCEL_STATUS;
  }
  return Status.OK_STATUS;
}

Fixed version (ground truth):
public IStatus doAction(){
  try {
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDComponent xSDCom=null;
    if (selection.getFirstElement() instanceof XSDSimpleTypeDefinition)     std=(XSDSimpleTypeDefinition)selection.getFirstElement();
 else {
      TreePath tPath=((TreeSelection)selection).getPaths()[0];
      for (int i=0; i < tPath.getSegmentCount(); i++) {
        if (tPath.getSegment(i) instanceof XSDSimpleTypeDefinition)         std=(XSDSimpleTypeDefinition)(tPath.getSegment(i));
      }
    }
    if (facetName.equals("String_Node_Str")) {
      editPattern();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editEnumeration();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editLength();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMinLength();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMaxLength();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editTotalDigits();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editFractionDigits();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMaxInclusive();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMaxExclusive();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMinInclusive();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editMinExclusive();
    }
 else     if (facetName.equals("String_Node_Str")) {
      editWhiteSpace();
    }
 else {
      MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + facetName);
      return Status.CANCEL_STATUS;
    }
    std.updateElement();
    page.getTreeViewer().refresh(true);
    page.markDirty();
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    return Status.CANCEL_STATUS;
  }
  return Status.OK_STATUS;
}