nus-yam/ex-repair huggingface dataset:
Program: 146132
Project: 146132
Buggy source:
public static void updateReference(Object decl,Object[] objs,String newValue){
  if (!(decl instanceof XSDElementDeclaration)) {
    return;
  }
  for (  Object obj : objs) {
    if (obj instanceof XSDParticle) {
      XSDTerm term=((XSDParticle)obj).getTerm();
      if (term instanceof XSDElementDeclaration) {
        XSDElementDeclaration xsdElem=(XSDElementDeclaration)term;
        if (xsdElem == decl) {
          ((XSDParticle)obj).setTerm((XSDElementDeclaration)decl);
          ((XSDParticle)obj).updateElement();
        }
      }
      XSDElementDeclaration elem=(XSDElementDeclaration)((XSDParticle)obj).getContent();
      if (elem.isElementDeclarationReference()) {
        if (elem.getResolvedElementDeclaration() == decl) {
          elem.setResolvedElementDeclaration((XSDElementDeclaration)decl);
        }
      }
    }
  }
}

Fixed version (ground truth):
public static void updateReference(Object decl,Object[] objs,String newValue){
  if (!(decl instanceof XSDElementDeclaration)) {
    return;
  }
  for (  Object obj : objs) {
    if (obj instanceof XSDParticle) {
      XSDTerm term=((XSDParticle)obj).getTerm();
      if (term instanceof XSDElementDeclaration) {
        XSDElementDeclaration xsdElem=(XSDElementDeclaration)term;
        if (xsdElem == decl) {
          ((XSDParticle)obj).setTerm((XSDElementDeclaration)decl);
          ((XSDParticle)obj).updateElement();
        }
      }
      if (!(((XSDParticle)obj).getContent() instanceof XSDElementDeclaration))       continue;
      XSDElementDeclaration elem=(XSDElementDeclaration)((XSDParticle)obj).getContent();
      if (elem.isElementDeclarationReference()) {
        if (elem.getResolvedElementDeclaration() == decl) {
          elem.setResolvedElementDeclaration((XSDElementDeclaration)decl);
        }
      }
    }
  }
}
Program: 146133
Project: 146133
Buggy source:
public static void updateReference(Object decl,Object[] objs,String newValue){
  if (!(decl instanceof XSDElementDeclaration)) {
    return;
  }
  for (  Object obj : objs) {
    if (obj instanceof XSDParticle) {
      XSDTerm term=((XSDParticle)obj).getTerm();
      if (term instanceof XSDElementDeclaration) {
        XSDElementDeclaration xsdElem=(XSDElementDeclaration)term;
        if (xsdElem == decl) {
          ((XSDParticle)obj).setTerm((XSDElementDeclaration)decl);
          ((XSDParticle)obj).updateElement();
        }
      }
      XSDElementDeclaration elem=(XSDElementDeclaration)((XSDParticle)obj).getContent();
      if (elem.isElementDeclarationReference()) {
        if (elem.getResolvedElementDeclaration() == decl) {
          elem.setResolvedElementDeclaration((XSDElementDeclaration)decl);
        }
      }
    }
  }
}

Fixed version (ground truth):
public static void updateReference(Object decl,Object[] objs,String newValue){
  if (!(decl instanceof XSDElementDeclaration)) {
    return;
  }
  for (  Object obj : objs) {
    if (obj instanceof XSDParticle) {
      XSDTerm term=((XSDParticle)obj).getTerm();
      if (term instanceof XSDElementDeclaration) {
        XSDElementDeclaration xsdElem=(XSDElementDeclaration)term;
        if (xsdElem == decl) {
          ((XSDParticle)obj).setTerm((XSDElementDeclaration)decl);
          ((XSDParticle)obj).updateElement();
        }
      }
      if (!(((XSDParticle)obj).getContent() instanceof XSDElementDeclaration))       continue;
      XSDElementDeclaration elem=(XSDElementDeclaration)((XSDParticle)obj).getContent();
      if (elem.isElementDeclarationReference()) {
        if (elem.getResolvedElementDeclaration() == decl) {
          elem.setResolvedElementDeclaration((XSDElementDeclaration)decl);
        }
      }
    }
  }
}
Program: 146136
Project: 146136
Buggy source:
private boolean isInclude(XSDAnnotation annotation){
  boolean include=false;
  if (annotation != null) {
    XSDAnnotationsStructure annotion=new XSDAnnotationsStructure(annotation);
    if ((!annotion.getWriteAccesses().values().contains(filter.getRole()) && filter.isReadOnly())) {
      return true;
    }
    if ((annotion.getWriteAccesses().values().contains(filter.getRole()) && filter.isWriteAccess())) {
      return true;
    }
    if ((annotion.getHiddenAccesses().values().contains(filter.getRole()) && filter.isHiddenAccess())) {
      return true;
    }
  }
  return include;
}

Fixed version (ground truth):
private boolean isInclude(XSDAnnotation annotation){
  boolean include=false;
  if (annotation != null) {
    XSDAnnotationsStructure annotion=new XSDAnnotationsStructure(annotation);
    if ((annotion.getWriteAccesses().values().contains(filter.getRole()) && filter.isWriteAccess())) {
      return true;
    }
    if ((annotion.getHiddenAccesses().values().contains(filter.getRole()) && filter.isHiddenAccess())) {
      return true;
    }
  }
 else {
    if ((filter.isReadOnly())) {
      return true;
    }
  }
  return include;
}
Program: 146137
Project: 146137
Buggy source:
private boolean isInclude(XSDAnnotation annotation){
  boolean include=false;
  if (annotation != null) {
    XSDAnnotationsStructure annotion=new XSDAnnotationsStructure(annotation);
    if ((!annotion.getWriteAccesses().values().contains(filter.getRole()) && filter.isReadOnly())) {
      return true;
    }
    if ((annotion.getWriteAccesses().values().contains(filter.getRole()) && filter.isWriteAccess())) {
      return true;
    }
    if ((annotion.getHiddenAccesses().values().contains(filter.getRole()) && filter.isHiddenAccess())) {
      return true;
    }
  }
  return include;
}

Fixed version (ground truth):
private boolean isInclude(XSDAnnotation annotation){
  boolean include=false;
  if (annotation != null) {
    XSDAnnotationsStructure annotion=new XSDAnnotationsStructure(annotation);
    if ((annotion.getWriteAccesses().values().contains(filter.getRole()) && filter.isWriteAccess())) {
      return true;
    }
    if ((annotion.getHiddenAccesses().values().contains(filter.getRole()) && filter.isHiddenAccess())) {
      return true;
    }
  }
 else {
    if ((filter.isReadOnly())) {
      return true;
    }
  }
  return include;
}
Program: 146140
Project: 146140
Buggy source:
/** 
 * create an "empty" item from scratch, set every text node to empty
 * @param viewPK
 * @throws RemoteException
 * @throws Exception
 */
private void createItem(String concept,int docIndex) throws RemoteException, Exception {
  WebContext ctx=WebContextFactory.get();
  Configuration config=Configuration.getInstance();
  String xml1="String_Node_Str" + concept + "String_Node_Str"+ concept+ "String_Node_Str";
  Document d=Util.parse(xml1);
  ctx.getSession().setAttribute("String_Node_Str" + docIndex,d);
  Map<String,XSElementDecl> map=CommonDWR.getConceptMap(config.getModel());
  XSComplexType xsct=(XSComplexType)(map.get(concept).getType());
  XSParticle[] xsp=xsct.getContentType().asParticle().getTerm().asModelGroup().getChildren();
  for (int j=0; j < xsp.length; j++) {
  }
}

Fixed version (ground truth):
/** 
 * create an "empty" item from scratch, set every text node to empty
 * @param viewPK
 * @throws RemoteException
 * @throws Exception
 */
private void createItem(String concept,int docIndex) throws RemoteException, Exception {
  WebContext ctx=WebContextFactory.get();
  Configuration config=Configuration.getInstance();
  String xml1="String_Node_Str" + concept + "String_Node_Str"+ concept+ "String_Node_Str";
  Document d=Util.parse(xml1);
  ctx.getSession().setAttribute("String_Node_Str" + docIndex,d);
  Map<String,XSElementDecl> map=CommonDWR.getConceptMap(config.getModel());
  XSComplexType xsct=(XSComplexType)(map.get(concept).getType());
  XSParticle[] xsp=xsct.getContentType().asParticle().getTerm().asModelGroup().getChildren();
  for (int j=0; j < xsp.length; j++) {
    setChilden(xsp[j],"String_Node_Str" + concept,docIndex);
  }
}
Program: 146143
Project: 146143
Buggy source:
/** 
 * create an "empty" item from scratch, set every text node to empty
 * @param viewPK
 * @throws RemoteException
 * @throws Exception
 */
private void createItem(String concept,int docIndex) throws RemoteException, Exception {
  WebContext ctx=WebContextFactory.get();
  Configuration config=Configuration.getInstance();
  String xml1="String_Node_Str" + concept + "String_Node_Str"+ concept+ "String_Node_Str";
  Document d=Util.parse(xml1);
  ctx.getSession().setAttribute("String_Node_Str" + docIndex,d);
  Map<String,XSElementDecl> map=CommonDWR.getConceptMap(config.getModel());
  XSComplexType xsct=(XSComplexType)(map.get(concept).getType());
  XSParticle[] xsp=xsct.getContentType().asParticle().getTerm().asModelGroup().getChildren();
  for (int j=0; j < xsp.length; j++) {
  }
}

Fixed version (ground truth):
/** 
 * create an "empty" item from scratch, set every text node to empty
 * @param viewPK
 * @throws RemoteException
 * @throws Exception
 */
private void createItem(String concept,int docIndex) throws RemoteException, Exception {
  WebContext ctx=WebContextFactory.get();
  Configuration config=Configuration.getInstance();
  String xml1="String_Node_Str" + concept + "String_Node_Str"+ concept+ "String_Node_Str";
  Document d=Util.parse(xml1);
  ctx.getSession().setAttribute("String_Node_Str" + docIndex,d);
  Map<String,XSElementDecl> map=CommonDWR.getConceptMap(config.getModel());
  XSComplexType xsct=(XSComplexType)(map.get(concept).getType());
  XSParticle[] xsp=xsct.getContentType().asParticle().getTerm().asModelGroup().getChildren();
  for (int j=0; j < xsp.length; j++) {
    setChilden(xsp[j],"String_Node_Str" + concept,docIndex);
  }
}
Program: 146145
Project: 146145
Buggy source:
public void widgetSelected(SelectionEvent e){
  dlg=new XpathSelectDialog(composite.getShell(),treeParent,"String_Node_Str",site,false,null);
  dlg.setBlockOnOpen(true);
  dlg.open();
  if (dlg.getReturnCode() == Window.OK) {
    String defalutText;
    if (smartViewSelected || !isTransfor)     defalutText=value;
 else     defalutText="String_Node_Str";
    if (dlg.getXpath() != null && dlg.getXpath().length() > 0) {
      int point=dlg.getXpath().indexOf("String_Node_Str");
      if (point >= 0)       text.setText(defalutText + dlg.getXpath().substring(0,point));
 else       text.setText(defalutText + dlg.getXpath());
    }
    dlg.close();
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  dlg=new XpathSelectDialog(composite.getShell(),treeParent,"String_Node_Str",site,false,null);
  dlg.setBlockOnOpen(true);
  dlg.open();
  if (dlg.getReturnCode() == Window.OK) {
    if (dlg.getXpath() != null && dlg.getXpath().length() > 0) {
      int point=dlg.getXpath().indexOf("String_Node_Str");
      if (point >= 0)       text.setText(Smart_view + dlg.getXpath().substring(0,point));
 else       text.setText(Smart_view + dlg.getXpath());
    }
    dlg.close();
  }
}
Program: 146148
Project: 146148
Buggy source:
public void widgetSelected(SelectionEvent e){
  dlg=new XpathSelectDialog(composite.getShell(),treeParent,"String_Node_Str",site,false,null);
  dlg.setBlockOnOpen(true);
  dlg.open();
  if (dlg.getReturnCode() == Window.OK) {
    String defalutText;
    if (smartViewSelected || !isTransfor)     defalutText=value;
 else     defalutText="String_Node_Str";
    if (dlg.getXpath() != null && dlg.getXpath().length() > 0) {
      int point=dlg.getXpath().indexOf("String_Node_Str");
      if (point >= 0)       text.setText(defalutText + dlg.getXpath().substring(0,point));
 else       text.setText(defalutText + dlg.getXpath());
    }
    dlg.close();
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  dlg=new XpathSelectDialog(composite.getShell(),treeParent,"String_Node_Str",site,false,null);
  dlg.setBlockOnOpen(true);
  dlg.open();
  if (dlg.getReturnCode() == Window.OK) {
    if (dlg.getXpath() != null && dlg.getXpath().length() > 0) {
      int point=dlg.getXpath().indexOf("String_Node_Str");
      if (point >= 0)       text.setText(Smart_view + dlg.getXpath().substring(0,point));
 else       text.setText(Smart_view + dlg.getXpath());
    }
    dlg.close();
  }
}
Program: 146159
Project: 146159
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  try {
    monitor.beginTask("String_Node_Str",toAddViewableList.size());
    for (Iterator<String> iter=toAddViewableList.iterator(); iter.hasNext(); ) {
      String keyPath=iter.next();
      if (keyPath.startsWith("String_Node_Str"))       keyPath=keyPath.substring(1);
      viewableBEsList.add(keyPath);
      commit();
      monitor.worked(1);
    }
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(parentShell,"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  try {
    monitor.beginTask("String_Node_Str",toAddViewableList.size());
    for (Iterator<String> iter=toAddViewableList.iterator(); iter.hasNext(); ) {
      String keyPath=iter.next();
      viewableBEsList.add(keyPath);
      commit();
      monitor.worked(1);
    }
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(parentShell,"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146160
Project: 146160
Buggy source:
public Object getAppendInfo(String key){
  return appendInfo.get(key);
}

Fixed version (ground truth):
public Object getAppendInfo(String key){
  if (appendInfo == null)   return null;
  return appendInfo.get(key);
}
Program: 146161
Project: 146161
Buggy source:
protected void provideViwerContent(XSDSchema xsdSchema){
  drillDownAdapter=new DrillDownAdapter(domViewer);
  domViewer.setLabelProvider(new XSDTreeLabelProvider());
  domViewer.setContentProvider(new XSDTreeContentProvider(site,xsdSchema));
  domViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent e){
      StructuredSelection sel=(StructuredSelection)e.getSelection();
      xpath=getXpath(sel);
      xpathText.setText(xpath);
    }
  }
);
  domViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true));
  domViewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof XSDFacet)       return 100;
      if (element instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)element;
        if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL))         return 300;
 else         if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.KEY_LITERAL))         return 301;
 else         return 302;
      }
      return 200;
    }
    public int compare(    Viewer theViewer,    Object e1,    Object e2){
      int cat1=category(e1);
      int cat2=category(e2);
      return cat1 - cat2;
    }
  }
);
  domViewer.setInput(site);
}

Fixed version (ground truth):
protected void provideViwerContent(XSDSchema xsdSchema){
  drillDownAdapter=new DrillDownAdapter(domViewer);
  domViewer.setLabelProvider(new XSDTreeLabelProvider());
  domViewer.setContentProvider(new XPathTreeContentProvider(site,xsdSchema));
  domViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent e){
      StructuredSelection sel=(StructuredSelection)e.getSelection();
      xpath=getXpath(sel);
      xpathText.setText(xpath);
    }
  }
);
  domViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true));
  domViewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof XSDFacet)       return 100;
      if (element instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)element;
        if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL))         return 300;
 else         if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.KEY_LITERAL))         return 301;
 else         return 302;
      }
      return 200;
    }
    public int compare(    Viewer theViewer,    Object e1,    Object e2){
      int cat1=category(e1);
      int cat2=category(e2);
      return cat1 - cat2;
    }
  }
);
  domViewer.setInput(site);
}
Program: 146167
Project: 146167
Buggy source:
protected void provideViwerContent(XSDSchema xsdSchema){
  drillDownAdapter=new DrillDownAdapter(domViewer);
  domViewer.setLabelProvider(new XSDTreeLabelProvider());
  domViewer.setContentProvider(new XSDTreeContentProvider(site,xsdSchema));
  domViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent e){
      StructuredSelection sel=(StructuredSelection)e.getSelection();
      xpath=getXpath(sel);
      xpathText.setText(xpath);
    }
  }
);
  domViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true));
  domViewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof XSDFacet)       return 100;
      if (element instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)element;
        if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL))         return 300;
 else         if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.KEY_LITERAL))         return 301;
 else         return 302;
      }
      return 200;
    }
    public int compare(    Viewer theViewer,    Object e1,    Object e2){
      int cat1=category(e1);
      int cat2=category(e2);
      return cat1 - cat2;
    }
  }
);
  domViewer.setInput(site);
}

Fixed version (ground truth):
protected void provideViwerContent(XSDSchema xsdSchema){
  drillDownAdapter=new DrillDownAdapter(domViewer);
  domViewer.setLabelProvider(new XSDTreeLabelProvider());
  domViewer.setContentProvider(new XPathTreeContentProvider(site,xsdSchema));
  domViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent e){
      StructuredSelection sel=(StructuredSelection)e.getSelection();
      xpath=getXpath(sel);
      xpathText.setText(xpath);
    }
  }
);
  domViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true));
  domViewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof XSDFacet)       return 100;
      if (element instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)element;
        if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL))         return 300;
 else         if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.KEY_LITERAL))         return 301;
 else         return 302;
      }
      return 200;
    }
    public int compare(    Viewer theViewer,    Object e1,    Object e2){
      int cat1=category(e1);
      int cat2=category(e2);
      return cat1 - cat2;
    }
  }
);
  domViewer.setInput(site);
}
Program: 146169
Project: 146169
Buggy source:
/** 
 * Generates an xml string from a node with or without the xml declaration  (not pretty formatted)
 * @param n the node
 * @return the xml string
 * @throws TransformerException
 */
public static String nodeToString(Node n,boolean omitXMLDeclaration) throws TransformerException {
  StringWriter sw=new StringWriter();
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  if (omitXMLDeclaration)   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
 else   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.transform(new DOMSource(n),new StreamResult(sw));
  if (sw == null)   return null;
  return sw.toString();
}

Fixed version (ground truth):
/** 
 * Generates an xml string from a node with or without the xml declaration  (not pretty formatted)
 * @param n the node
 * @return the xml string
 * @throws TransformerException
 */
public static String nodeToString(Node n,boolean omitXMLDeclaration) throws TransformerException {
  StringWriter sw=new StringWriter();
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  if (omitXMLDeclaration)   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
 else   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.transform(new DOMSource(n),new StreamResult(sw));
  if (sw == null)   return null;
  return sw.toString().replaceAll("String_Node_Str","String_Node_Str");
}
Program: 146171
Project: 146171
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  try {
    monitor.beginTask("String_Node_Str",toAddViewableList.size());
    for (Iterator<String> iter=toAddViewableList.iterator(); iter.hasNext(); ) {
      String keyPath=iter.next();
      if (keyPath.startsWith("String_Node_Str"))       keyPath=keyPath.substring(1);
      viewableBEsList.add(keyPath);
      commit();
      monitor.worked(1);
    }
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(parentShell,"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  try {
    monitor.beginTask("String_Node_Str",toAddViewableList.size());
    for (Iterator<String> iter=toAddViewableList.iterator(); iter.hasNext(); ) {
      String keyPath=iter.next();
      viewableBEsList.add(keyPath);
      commit();
      monitor.worked(1);
    }
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(parentShell,"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146172
Project: 146172
Buggy source:
public Object getAppendInfo(String key){
  return appendInfo.get(key);
}

Fixed version (ground truth):
public Object getAppendInfo(String key){
  if (appendInfo == null)   return null;
  return appendInfo.get(key);
}
Program: 146173
Project: 146173
Buggy source:
/** 
 * Generates an xml string from a node with or without the xml declaration  (not pretty formatted)
 * @param n the node
 * @return the xml string
 * @throws TransformerException
 */
public static String nodeToString(Node n,boolean omitXMLDeclaration) throws TransformerException {
  StringWriter sw=new StringWriter();
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  if (omitXMLDeclaration)   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
 else   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.transform(new DOMSource(n),new StreamResult(sw));
  if (sw == null)   return null;
  return sw.toString();
}

Fixed version (ground truth):
/** 
 * Generates an xml string from a node with or without the xml declaration  (not pretty formatted)
 * @param n the node
 * @return the xml string
 * @throws TransformerException
 */
public static String nodeToString(Node n,boolean omitXMLDeclaration) throws TransformerException {
  StringWriter sw=new StringWriter();
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  if (omitXMLDeclaration)   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
 else   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.transform(new DOMSource(n),new StreamResult(sw));
  if (sw == null)   return null;
  return sw.toString().replaceAll("String_Node_Str","String_Node_Str");
}
Program: 146181
Project: 146181
Buggy source:
public void setProcessStep(WSTransformerProcessStep processStep,int index){
  this.processStep=processStep;
  availableVariables.clear();
  for (int i=0; i <= index; i++) {
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getInputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getOutputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
  }
  refreshViewers();
  refreshCombo();
}

Fixed version (ground truth):
public void setProcessStep(WSTransformerProcessStep processStep,int index){
  this.processStep=processStep;
  availableVariables.clear();
  for (int i=0; i <= index; i++) {
    if (transformer.getProcessSteps()[i].getDisabled())     continue;
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getInputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getOutputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
  }
  refreshViewers();
  refreshCombo();
}
Program: 146185
Project: 146185
Buggy source:
public void setProcessStep(WSTransformerProcessStep processStep,int index){
  this.processStep=processStep;
  availableVariables.clear();
  for (int i=0; i <= index; i++) {
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getInputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getOutputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
  }
  refreshViewers();
  refreshCombo();
}

Fixed version (ground truth):
public void setProcessStep(WSTransformerProcessStep processStep,int index){
  this.processStep=processStep;
  availableVariables.clear();
  for (int i=0; i <= index; i++) {
    if (transformer.getProcessSteps()[i].getDisabled())     continue;
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getInputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getOutputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
  }
  refreshViewers();
  refreshCombo();
}
Program: 146186
Project: 146186
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getForeignKeyInfos().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setForeignKeyInfos(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getForeignKeyInfos().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationForeignKeyInfo_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setForeignKeyInfos(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146187
Project: 146187
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getHiddenAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setHiddenAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getHiddenAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationHidden_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setHiddenAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146188
Project: 146188
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getTargetSystems().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setTargetSystems(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getTargetSystems().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationTargetSystems_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setTargetSystems(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146189
Project: 146189
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getWriteAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setWriteAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getWriteAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationWrite_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setWriteAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146190
Project: 146190
Buggy source:
/** 
 * @param parentShell
 */
public AnnotationOrderedListsDialog(ArrayList<String> xPaths,SelectionListener caller,Shell parentShell,String title,String columnName){
  super(parentShell);
  setShellStyle(this.getShellStyle() | SWT.RESIZE);
  this.xPaths=xPaths;
  this.caller=caller;
  this.title=title;
  this.columnName=columnName;
}

Fixed version (ground truth):
/** 
 * @param parentShell
 */
public AnnotationOrderedListsDialog(ArrayList<String> xPaths,SelectionListener caller,Shell parentShell,String title,String columnName,AMainPageV2 parentPage,int actionType){
  super(parentShell);
  setShellStyle(this.getShellStyle() | SWT.RESIZE);
  this.xPaths=xPaths;
  this.caller=caller;
  this.title=title;
  this.columnName=columnName;
  this.parentPage=parentPage;
  this.xObject=parentPage.getXObject();
  this.actionType=actionType;
}
Program: 146192
Project: 146192
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getForeignKeyInfos().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setForeignKeyInfos(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getForeignKeyInfos().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationForeignKeyInfo_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setForeignKeyInfos(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146193
Project: 146193
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getHiddenAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setHiddenAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getHiddenAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationHidden_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setHiddenAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146194
Project: 146194
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getTargetSystems().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setTargetSystems(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getTargetSystems().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationTargetSystems_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setTargetSystems(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}