nus-yam/ex-repair huggingface dataset:
Program: 148982
Project: 148982
Buggy source:
public void widgetSelected(SelectionEvent e){
  if (refCombo.getText() != "String_Node_Str" && refCombo.getText() != null) {
    elementNameText.setText("String_Node_Str");
    elementNameText.setEditable(false);
  }
 else {
    elementNameText.setEditable(true);
  }
}

Fixed version (ground truth):
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e){
  inherit=checkBox.getSelection();
}
Program: 148983
Project: 148983
Buggy source:
/** 
 * @param parentShell
 */
public BusinessElementInputDialog(SelectionListener caller,Shell parentShell,String title,String elementName,String refName,Collection<String> decls,int minOccurs,int maxOccurs){
  super(parentShell);
  this.caller=caller;
  this.title=title;
  this.elementName=elementName;
  this.refName=refName;
  this.elementDeclarations=decls;
  this.minOccurs=minOccurs;
  this.maxOccurs=maxOccurs;
}

Fixed version (ground truth):
/** 
 * @param parentShell
 */
public BusinessElementInputDialog(SelectionListener caller,Shell parentShell,String title,String elementName,String refName,Collection<String> decls,int minOccurs,int maxOccurs,boolean isNew){
  super(parentShell);
  this.caller=caller;
  this.title=title;
  this.elementName=elementName;
  this.refName=refName;
  this.elementDeclarations=decls;
  this.minOccurs=minOccurs;
  this.maxOccurs=maxOccurs;
  this.isNew=isNew;
}
Program: 148985
Project: 148985
Buggy source:
@Override public void fillContextMenu(TreeObject xobject,IMenuManager manager){
switch (xobject.getType()) {
case TreeObject._SERVER_:
    manager.add(new VersioningXObjectAction(ServerView.show(),VersioningXObjectAction.ACTION_TYPE_TAGUNIVERSE));
  break;
default :
if (xobject.getType() != TreeObject.WORKFLOW_PROCESS && xobject.getType() != TreeObject.JOB && Util.hasTags(xobject)) manager.add(new VersioningXObjectAction(ServerView.show(),VersioningXObjectAction.ACTION_TYPE_VERSIONS));
break;
}
}

Fixed version (ground truth):
@Override public void fillContextMenu(TreeObject xobject,IMenuManager manager){
switch (xobject.getType()) {
case TreeObject._SERVER_:
    manager.add(new VersioningXObjectAction(ServerView.show(),VersioningXObjectAction.ACTION_TYPE_TAGUNIVERSE));
  break;
default :
if (xobject.getType() != TreeObject.WORKFLOW_PROCESS && xobject.getType() != TreeObject.JOB && Util.hasTags(xobject) && xobject.getType() != TreeObject.DATA_MODEL_TYPES_RESOURCE && xobject.getType() != TreeObject.DATA_MODEL_RESOURCE) manager.add(new VersioningXObjectAction(ServerView.show(),VersioningXObjectAction.ACTION_TYPE_VERSIONS));
break;
}
}
Program: 148986
Project: 148986
Buggy source:
public ArrayList<ArrayList<String>> getCrossReferencingContent(String tableName) throws XtentisWebappException {
  try {
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(Configuration.datacluster),tableName,null,-1,0,-1)).getStrings();
    DocumentBuilder documentBuilder=DocumentBuilderFactory.newInstance().newDocumentBuilder();
    XPath xpath=XPathFactory.newInstance().newXPath();
    ArrayList<ArrayList<String>> list=new ArrayList<ArrayList<String>>();
    for (int i=1; i < results.length; i++) {
      Element lineElement=documentBuilder.parse(new InputSource(new StringReader(results[i]))).getDocumentElement();
      NodeList rowList=(NodeList)xpath.evaluate("String_Node_Str",lineElement,XPathConstants.NODESET);
      ArrayList<String> fields=new ArrayList<String>();
      for (int j=0; j < rowList.getLength(); j++) {
{
          NodeList textNodes=rowList.item(j).getChildNodes();
          String val="String_Node_Str";
          if (textNodes.getLength() > 0) {
            String text=textNodes.item(0).getNodeValue();
            if (text != null)             val=text;
          }
          fields.add(val);
        }
      }
      list.add(fields);
    }
    if (results.length > 0)     return list;
 else     return null;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public ArrayList<ArrayList<String>> getCrossReferencingContent(String tableName) throws XtentisWebappException {
  try {
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(Configuration.datacluster),tableName,null,-1,0,-1)).getStrings();
    DocumentBuilder documentBuilder=DocumentBuilderFactory.newInstance().newDocumentBuilder();
    XPath xpath=XPathFactory.newInstance().newXPath();
    ArrayList<ArrayList<String>> list=new ArrayList<ArrayList<String>>();
    for (int i=0; i < results.length; i++) {
      Element lineElement=documentBuilder.parse(new InputSource(new StringReader(results[i]))).getDocumentElement();
      NodeList rowList=(NodeList)xpath.evaluate("String_Node_Str",lineElement,XPathConstants.NODESET);
      ArrayList<String> fields=new ArrayList<String>();
      for (int j=0; j < rowList.getLength(); j++) {
{
          NodeList textNodes=rowList.item(j).getChildNodes();
          String val="String_Node_Str";
          if (textNodes.getLength() > 0) {
            String text=textNodes.item(0).getNodeValue();
            if (text != null)             val=text;
          }
          fields.add(val);
        }
      }
      list.add(fields);
    }
    if (results.length > 0)     return list;
 else     return null;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 148987
Project: 148987
Buggy source:
public ListRange getUsers(String regex,String language) throws Exception {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + regex + "String_Node_Str"+ language);
  try {
    WSWhereItem wi=new WSWhereItem();
    if ((regex == null) || ("String_Node_Str".equals(regex)) || "String_Node_Str".equals(regex)) {
      wi=null;
    }
 else {
      WSWhereCondition wc=new WSWhereCondition("String_Node_Str",WSWhereOperator.CONTAINS,regex,WSStringPredicate.NONE,true);
      wi.setWhereCondition(wc);
    }
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(dataclusterPK),"String_Node_Str",wi,0,0,Integer.MAX_VALUE)).getStrings();
    ArrayList<User> names=new ArrayList<User>();
    for (int i=1; i < results.length; i++) {
      User user=User.parse(results[i]);
      names.add(user);
    }
    ListRange listRange=new ListRange();
    listRange.setData(names.toArray(new User[names.size()]));
    listRange.setTotalSize(names.size());
    return listRange;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new Exception(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public ListRange getUsers(String regex,String language) throws Exception {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + regex + "String_Node_Str"+ language);
  try {
    WSWhereItem wi=new WSWhereItem();
    if ((regex == null) || ("String_Node_Str".equals(regex)) || "String_Node_Str".equals(regex)) {
      wi=null;
    }
 else {
      WSWhereCondition wc=new WSWhereCondition("String_Node_Str",WSWhereOperator.CONTAINS,regex,WSStringPredicate.NONE,true);
      wi.setWhereCondition(wc);
    }
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(dataclusterPK),"String_Node_Str",wi,0,0,Integer.MAX_VALUE)).getStrings();
    ArrayList<User> names=new ArrayList<User>();
    for (int i=0; i < results.length; i++) {
      User user=User.parse(results[i]);
      names.add(user);
    }
    ListRange listRange=new ListRange();
    listRange.setData(names.toArray(new User[names.size()]));
    listRange.setTotalSize(names.size());
    return listRange;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new Exception(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 148988
Project: 148988
Buggy source:
public ArrayList<ArrayList<String>> getCrossReferencingContent(String tableName) throws XtentisWebappException {
  try {
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(Configuration.datacluster),tableName,null,-1,0,-1)).getStrings();
    DocumentBuilder documentBuilder=DocumentBuilderFactory.newInstance().newDocumentBuilder();
    XPath xpath=XPathFactory.newInstance().newXPath();
    ArrayList<ArrayList<String>> list=new ArrayList<ArrayList<String>>();
    for (int i=0; i < results.length; i++) {
      Element lineElement=documentBuilder.parse(new InputSource(new StringReader(results[i]))).getDocumentElement();
      NodeList rowList=(NodeList)xpath.evaluate("String_Node_Str",lineElement,XPathConstants.NODESET);
      ArrayList<String> fields=new ArrayList<String>();
      for (int j=0; j < rowList.getLength(); j++) {
{
          NodeList textNodes=rowList.item(j).getChildNodes();
          String val="String_Node_Str";
          if (textNodes.getLength() > 0) {
            String text=textNodes.item(0).getNodeValue();
            if (text != null)             val=text;
          }
          fields.add(val);
        }
      }
      list.add(fields);
    }
    if (results.length > 0)     return list;
 else     return null;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public ArrayList<ArrayList<String>> getCrossReferencingContent(String tableName) throws XtentisWebappException {
  try {
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(Configuration.datacluster),tableName,null,-1,0,-1)).getStrings();
    DocumentBuilder documentBuilder=DocumentBuilderFactory.newInstance().newDocumentBuilder();
    XPath xpath=XPathFactory.newInstance().newXPath();
    ArrayList<ArrayList<String>> list=new ArrayList<ArrayList<String>>();
    for (int i=1; i < results.length; i++) {
      Element lineElement=documentBuilder.parse(new InputSource(new StringReader(results[i]))).getDocumentElement();
      NodeList rowList=(NodeList)xpath.evaluate("String_Node_Str",lineElement,XPathConstants.NODESET);
      ArrayList<String> fields=new ArrayList<String>();
      for (int j=0; j < rowList.getLength(); j++) {
{
          NodeList textNodes=rowList.item(j).getChildNodes();
          String val="String_Node_Str";
          if (textNodes.getLength() > 0) {
            String text=textNodes.item(0).getNodeValue();
            if (text != null)             val=text;
          }
          fields.add(val);
        }
      }
      list.add(fields);
    }
    if (results.length > 0)     return list;
 else     return null;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 148989
Project: 148989
Buggy source:
public ListRange getUsers(String regex,String language) throws Exception {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + regex + "String_Node_Str"+ language);
  try {
    WSWhereItem wi=new WSWhereItem();
    if ((regex == null) || ("String_Node_Str".equals(regex)) || "String_Node_Str".equals(regex)) {
      wi=null;
    }
 else {
      WSWhereCondition wc=new WSWhereCondition("String_Node_Str",WSWhereOperator.CONTAINS,regex,WSStringPredicate.NONE,true);
      wi.setWhereCondition(wc);
    }
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(dataclusterPK),"String_Node_Str",wi,0,0,Integer.MAX_VALUE)).getStrings();
    ArrayList<User> names=new ArrayList<User>();
    for (int i=0; i < results.length; i++) {
      User user=User.parse(results[i]);
      names.add(user);
    }
    ListRange listRange=new ListRange();
    listRange.setData(names.toArray(new User[names.size()]));
    listRange.setTotalSize(names.size());
    return listRange;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new Exception(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public ListRange getUsers(String regex,String language) throws Exception {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + regex + "String_Node_Str"+ language);
  try {
    WSWhereItem wi=new WSWhereItem();
    if ((regex == null) || ("String_Node_Str".equals(regex)) || "String_Node_Str".equals(regex)) {
      wi=null;
    }
 else {
      WSWhereCondition wc=new WSWhereCondition("String_Node_Str",WSWhereOperator.CONTAINS,regex,WSStringPredicate.NONE,true);
      wi.setWhereCondition(wc);
    }
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(dataclusterPK),"String_Node_Str",wi,0,0,Integer.MAX_VALUE)).getStrings();
    ArrayList<User> names=new ArrayList<User>();
    for (int i=1; i < results.length; i++) {
      User user=User.parse(results[i]);
      names.add(user);
    }
    ListRange listRange=new ListRange();
    listRange.setData(names.toArray(new User[names.size()]));
    listRange.setTotalSize(names.size());
    return listRange;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new Exception(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 148990
Project: 148990
Buggy source:
@Override public void fillContextMenu(TreeObject xobject,IMenuManager manager){
switch (xobject.getType()) {
case TreeObject._SERVER_:
    manager.add(new VersioningXObjectAction(ServerView.show(),VersioningXObjectAction.ACTION_TYPE_VERSIONS));
  break;
default :
if (xobject.getType() != TreeObject.WORKFLOW_PROCESS && xobject.getType() != TreeObject.JOB && Util.hasTags(xobject)) manager.add(new VersioningXObjectAction(ServerView.show(),VersioningXObjectAction.ACTION_TYPE_TAGUNIVERSE));
break;
}
}

Fixed version (ground truth):
@Override public void fillContextMenu(TreeObject xobject,IMenuManager manager){
switch (xobject.getType()) {
case TreeObject._SERVER_:
    manager.add(new VersioningXObjectAction(ServerView.show(),VersioningXObjectAction.ACTION_TYPE_TAGUNIVERSE));
  break;
default :
if (xobject.getType() != TreeObject.WORKFLOW_PROCESS && xobject.getType() != TreeObject.JOB && Util.hasTags(xobject)) manager.add(new VersioningXObjectAction(ServerView.show(),VersioningXObjectAction.ACTION_TYPE_VERSIONS));
break;
}
}
Program: 148994
Project: 148994
Buggy source:
public ProcessWidget add(String name){
  if (map.get(name) != null) {
    MessageDialog.openWarning(null,"String_Node_Str",name + "String_Node_Str");
    return null;
  }
  final ProcessWidget pw=new ProcessWidget(toolkit,parent,name,this,viewer);
  pw.getDelButton().addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      delete(pw.getName());
    }
  }
);
  map.put(name,pw);
  parent.layout(true);
  ccrollComposite.setMinSize(400,31 * map.size());
  return pw;
}

Fixed version (ground truth):
public ProcessWidget add(String name){
  if (map.get(name) != null) {
    MessageDialog.openWarning(null,"String_Node_Str",name + "String_Node_Str");
    return null;
  }
  final ProcessWidget pw=new ProcessWidget(toolkit,parent,name,this,viewer);
  pw.getDelButton().addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      try {
        delete(pw.getName());
        port.workflowDeleteProcessInstances(new WSWorkflowDeleteProcessInstancesRequest(pw.getName()));
      }
 catch (      RemoteException e1) {
        e1.printStackTrace();
      }
    }
  }
);
  map.put(name,pw);
  parent.layout(true);
  ccrollComposite.setMinSize(400,31 * map.size());
  return pw;
}
Program: 148995
Project: 148995
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  delete(pw.getName());
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  try {
    delete(pw.getName());
    port.workflowDeleteProcessInstances(new WSWorkflowDeleteProcessInstancesRequest(pw.getName()));
  }
 catch (  RemoteException e1) {
    e1.printStackTrace();
  }
}
Program: 148996
Project: 148996
Buggy source:
public ProcessList(FormToolkit toolkit,Composite composite,ScrolledComposite ccrollComposite,TableViewer viewer){
  this.toolkit=toolkit;
  this.parent=composite;
  this.ccrollComposite=ccrollComposite;
  this.viewer=viewer;
}

Fixed version (ground truth):
public ProcessList(XtentisPort port,FormToolkit toolkit,Composite composite,ScrolledComposite ccrollComposite,TableViewer viewer){
  this.port=port;
  this.toolkit=toolkit;
  this.parent=composite;
  this.ccrollComposite=ccrollComposite;
  this.viewer=viewer;
}
Program: 149000
Project: 149000
Buggy source:
public void run(){
  if (this.server != null) {
    ISelection selection=server.getViewer().getSelection();
    xobject=(TreeObject)((IStructuredSelection)selection).getFirstElement();
  }
  if (xobject.getType() != TreeObject.JOB)   return;
  try {
    XtentisPort port=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
    xobject.getParent().removeChild(xobject);
    String filename=xobject.getDisplayName();
    String jobname=filename.substring(0,filename.lastIndexOf("String_Node_Str"));
    String version=filename.substring(filename.lastIndexOf("String_Node_Str") + 1);
    JobInfo info=new JobInfo(jobname,version);
    port.deleteMDMJob(new WSDELMDMJob(jobname,version));
    String endpointaddress=xobject.getEndpointAddress();
    String uploadURL=new URL(endpointaddress).getProtocol() + "String_Node_Str" + new URL(endpointaddress).getHost()+ "String_Node_Str"+ new URL(endpointaddress).getPort()+ "String_Node_Str"+ filename;
    String remoteFile=Util.uploadFileToAppServer(uploadURL,null,filename,"String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
public void run(){
  if (this.server != null) {
    ISelection selection=server.getViewer().getSelection();
    xobject=(TreeObject)((IStructuredSelection)selection).getFirstElement();
  }
  if (xobject.getType() != TreeObject.JOB)   return;
  try {
    XtentisPort port=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
    xobject.getParent().removeChild(xobject);
    String filename=xobject.getDisplayName();
    String jobname=filename.substring(0,filename.lastIndexOf("String_Node_Str"));
    String version=filename.substring(filename.lastIndexOf("String_Node_Str") + 1);
    port.deleteMDMJob(new WSDELMDMJob(jobname,version));
    String endpointaddress=xobject.getEndpointAddress();
    String uploadURL=new URL(endpointaddress).getProtocol() + "String_Node_Str" + new URL(endpointaddress).getHost()+ "String_Node_Str"+ new URL(endpointaddress).getPort()+ "String_Node_Str"+ filename;
    String remoteFile=Util.uploadFileToAppServer(uploadURL,filename,"String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
  }
}
Program: 149001
Project: 149001
Buggy source:
/** 
 * get the JobInfo:jobName and version
 * @param fileName
 * @return
 */
public JobInfo getJobInfo(String fileName){
  JobInfo jobInfo=new JobInfo("String_Node_Str","String_Node_Str");
  try {
    ZipInputStream in=new ZipInputStream(new FileInputStream(fileName));
    ZipEntry z=null;
    String name=fileName.substring(fileName.lastIndexOf("String_Node_Str") == -1 ? 0 : fileName.lastIndexOf("String_Node_Str") + 1);
    try {
      String jobName="String_Node_Str";
      while ((z=in.getNextEntry()) != null) {
        String dirName=z.getName();
        if (dirName.matches("String_Node_Str")) {
          jobName=dirName.substring(dirName.lastIndexOf("String_Node_Str") + 1,dirName.lastIndexOf("String_Node_Str"));
          jobInfo.setJobname(jobName.substring(0,jobName.lastIndexOf("String_Node_Str")));
          jobInfo.setJobversion(jobName.substring(jobName.lastIndexOf("String_Node_Str") + 1));
          return jobInfo;
        }
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
 finally {
      try {
        in.close();
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
  return jobInfo;
}

Fixed version (ground truth):
/** 
 * get the JobInfo:jobName and version
 * @param fileName
 * @return
 */
public JobInfo getJobInfo(String fileName){
  JobInfo jobInfo=new JobInfo("String_Node_Str","String_Node_Str");
  try {
    ZipInputStream in=new ZipInputStream(new FileInputStream(fileName));
    ZipEntry z=null;
    try {
      String jobName="String_Node_Str";
      String jobVersion="String_Node_Str";
      while ((z=in.getNextEntry()) != null) {
        String dirName=z.getName();
        if (dirName.matches("String_Node_Str")) {
          jobName=new File(dirName).getName();
          jobName=jobName.substring(0,jobName.lastIndexOf("String_Node_Str"));
        }
        if (dirName.matches("String_Node_Str")) {
          jobName=new File(dirName).getParentFile().getName();
          Pattern p=Pattern.compile("String_Node_Str");
          Matcher m=p.matcher(jobName);
          int index=m.groupCount();
          jobVersion=m.group(index);
          jobVersion=jobVersion.replaceAll("String_Node_Str","String_Node_Str");
        }
      }
      jobInfo.setJobname(jobName);
      jobInfo.setJobversion(jobVersion);
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
    }
 finally {
      in.close();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return jobInfo;
}
Program: 149003
Project: 149003
Buggy source:
public void run(){
  if (this.server != null) {
    ISelection selection=server.getViewer().getSelection();
    xobject=(TreeParent)((IStructuredSelection)selection).getFirstElement();
  }
  if (xobject.getType() != TreeObject.WORKFLOW)   return;
  try {
    XtentisPort port=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
    FileDialog fileDialog=new FileDialog(server.getSite().getShell(),SWT.OPEN);
    fileDialog.setFilterExtensions(new String[]{"String_Node_Str"});
    String name=fileDialog.open();
    if (name != null) {
      String endpointaddress=xobject.getEndpointAddress();
      String uploadURL=new URL(endpointaddress).getProtocol() + "String_Node_Str" + new URL(endpointaddress).getHost()+ "String_Node_Str"+ new URL(endpointaddress).getPort()+ "String_Node_Str";
      String remoteFile=Util.uploadFileToAppServer(uploadURL,null,name,"String_Node_Str","String_Node_Str");
      WSWorkflowProcessDefinitionUUID uuid=port.workflowDeploy(new WSWorkflowDeploy(remoteFile));
      TreeObject obj=new TreeObject(uuid.getProcessName() + "String_Node_Str" + uuid.getProcessVersion(),xobject.getServerRoot(),TreeObject.WORKFLOW_PROCESS,uuid,null);
      xobject.addChild(obj);
      BrowseViewAction action=new BrowseViewAction(server);
      action.setObject(obj);
      action.run();
      new ServerRefreshAction(server,xobject.getServerRoot()).run();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  if (this.server != null) {
    ISelection selection=server.getViewer().getSelection();
    xobject=(TreeParent)((IStructuredSelection)selection).getFirstElement();
  }
  if (xobject.getType() != TreeObject.WORKFLOW)   return;
  try {
    XtentisPort port=Util.getPort(new URL(xobject.getEndpointAddress()),xobject.getUniverse(),xobject.getUsername(),xobject.getPassword());
    FileDialog fileDialog=new FileDialog(server.getSite().getShell(),SWT.OPEN);
    fileDialog.setFilterExtensions(new String[]{"String_Node_Str"});
    String name=fileDialog.open();
    if (name != null) {
      String endpointaddress=xobject.getEndpointAddress();
      String uploadURL=new URL(endpointaddress).getProtocol() + "String_Node_Str" + new URL(endpointaddress).getHost()+ "String_Node_Str"+ new URL(endpointaddress).getPort()+ "String_Node_Str";
      String remoteFile=Util.uploadFileToAppServer(uploadURL,name,"String_Node_Str","String_Node_Str");
      WSWorkflowProcessDefinitionUUID uuid=port.workflowDeploy(new WSWorkflowDeploy(remoteFile));
      TreeObject obj=new TreeObject(uuid.getProcessName() + "String_Node_Str" + uuid.getProcessVersion(),xobject.getServerRoot(),TreeObject.WORKFLOW_PROCESS,uuid,null);
      xobject.addChild(obj);
      BrowseViewAction action=new BrowseViewAction(server);
      action.setObject(obj);
      action.run();
      new ServerRefreshAction(server,xobject.getServerRoot()).run();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 149004
Project: 149004
Buggy source:
public void checkServiceStatus(){
  try {
    String result="String_Node_Str";
    String URLPath="String_Node_Str" + this.jobName + "String_Node_Str"+ this.jobName.substring(0,this.jobName.lastIndexOf("String_Node_Str"));
    HttpClient client=new HttpClient();
    HttpMethod method=new GetMethod(URLPath);
    client.executeMethod(method);
    if (method.getStatusLine().toString().indexOf("String_Node_Str") != -1)     statusLabel.setText("String_Node_Str");
 else     statusLabel.setText("String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void checkServiceStatus(){
  try {
    String URLPath="String_Node_Str" + getXObject().getEndpointHost() + "String_Node_Str"+ getXObject().getEndpointPort()+ "String_Node_Str"+ this.jobName+ "String_Node_Str"+ this.jobName.substring(0,this.jobName.lastIndexOf("String_Node_Str"));
    HttpClient client=new HttpClient();
    HttpMethod method=new GetMethod(URLPath);
    client.executeMethod(method);
    if (method.getStatusLine().toString().indexOf("String_Node_Str") != -1)     statusLabel.setText("String_Node_Str");
 else     statusLabel.setText("String_Node_Str");
    method.releaseConnection();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149005
Project: 149005
Buggy source:
/** 
 * FILE UPLOAD Multi-Part Form Post
 */
public static String uploadFileToAppServer(String URL,JobInfo info,String localFilename,String username,String password) throws XtentisException {
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  HttpClient client=new HttpClient();
  MultipartPostMethod mppost=new MultipartPostMethod(URL);
  String response=null;
  try {
    client.setConnectionTimeout(60000);
    client.getState().setAuthenticationPreemptive(true);
    client.getState().setCredentials(null,null,new UsernamePasswordCredentials(username,password));
    if (info != null)     mppost.addParameter(info.getJobname() + "String_Node_Str" + info.getJobversion()+ "String_Node_Str",new File(localFilename));
    client.executeMethod(mppost);
    if (mppost.getStatusCode() != HttpStatus.SC_OK) {
      throw new XtentisException("String_Node_Str" + mppost.getStatusCode() + "String_Node_Str"+ mppost.getStatusText());
    }
    response=mppost.getResponseBodyAsString();
    mppost.releaseConnection();
    return response;
  }
 catch (  Exception e) {
    mppost.releaseConnection();
    e.printStackTrace();
    throw new XtentisException(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * FILE UPLOAD Multi-Part Form Post
 */
public static String uploadFileToAppServer(String URL,String localFilename,String username,String password) throws XtentisException {
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  HttpClient client=new HttpClient();
  MultipartPostMethod mppost=new MultipartPostMethod(URL);
  String response=null;
  String fileName=localFilename;
  try {
    client.setConnectionTimeout(60000);
    client.getState().setAuthenticationPreemptive(true);
    client.getState().setCredentials(null,null,new UsernamePasswordCredentials(username,password));
    if (URL.indexOf("String_Node_Str") == -1) {
      if (URL.indexOf("String_Node_Str") != -1) {
        fileName=URL.substring(URL.indexOf("String_Node_Str") + 1);
      }
      mppost.addParameter(fileName,new File(localFilename));
    }
    client.executeMethod(mppost);
    if (mppost.getStatusCode() != HttpStatus.SC_OK) {
      throw new XtentisException("String_Node_Str" + mppost.getStatusCode() + "String_Node_Str"+ mppost.getStatusText());
    }
    response=mppost.getResponseBodyAsString();
    mppost.releaseConnection();
    return response;
  }
 catch (  Exception e) {
    mppost.releaseConnection();
    e.printStackTrace();
    throw new XtentisException(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149006
Project: 149006
Buggy source:
protected void commit(){
  try {
    if (this.refreshing)     return;
    this.comitting=true;
    WSUniverse ws=(WSUniverse)(getXObject().getWsObject());
    ws.setName(universe.getName());
    ws.setDefaultItemsRevisionID(universe.getDefaultReversionID());
    ws.setDescription(universe.getDescription());
    List<WSUniverseXtentisObjectsRevisionIDs> xtentisObjectsRevisionIDs=new ArrayList<WSUniverseXtentisObjectsRevisionIDs>();
    for (    KeyValue line : universe.getXtentisObjectsList()) {
      String name=line.key;
      if (EXtentisObjects.Transformer.getDisplayName().equals(name)) {
        name=EXtentisObjects.Transformer.getName();
      }
      xtentisObjectsRevisionIDs.add(new WSUniverseXtentisObjectsRevisionIDs(name,line.value));
    }
    ws.setXtentisObjectsRevisionIDs(xtentisObjectsRevisionIDs.toArray(new WSUniverseXtentisObjectsRevisionIDs[xtentisObjectsRevisionIDs.size()]));
    List<WSUniverseItemsRevisionIDs> itemIds=new ArrayList<WSUniverseItemsRevisionIDs>();
    for (    Line line : universe.getItemsList()) {
      itemIds.add(new WSUniverseItemsRevisionIDs(line.keyValues.get(0).value,line.keyValues.get(1).value));
    }
    ws.setItemsRevisionIDs(itemIds.toArray(new WSUniverseItemsRevisionIDs[itemIds.size()]));
    this.comitting=false;
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
protected void commit(){
  try {
    if (this.refreshing)     return;
    this.comitting=true;
    WSUniverse ws=(WSUniverse)(getXObject().getWsObject());
    ws.setName(universe.getName());
    ws.setDefaultItemsRevisionID(universe.getDefaultReversionID());
    ws.setDescription(universe.getDescription());
    List<WSUniverseXtentisObjectsRevisionIDs> xtentisObjectsRevisionIDs=new ArrayList<WSUniverseXtentisObjectsRevisionIDs>();
    for (    KeyValue line : universe.getXtentisObjectsList()) {
      String name=line.key;
      if (EXtentisObjects.Transformer.getDisplayName().equals(name)) {
        name=EXtentisObjects.Transformer.getName();
      }
      xtentisObjectsRevisionIDs.add(new WSUniverseXtentisObjectsRevisionIDs(name,line.value));
    }
    ws.setXtentisObjectsRevisionIDs(xtentisObjectsRevisionIDs.toArray(new WSUniverseXtentisObjectsRevisionIDs[xtentisObjectsRevisionIDs.size()]));
    List<WSUniverseItemsRevisionIDs> itemIds=new ArrayList<WSUniverseItemsRevisionIDs>();
    java.util.List<Line> lines=(java.util.List<Line>)itemsViewer.getViewer().getInput();
    for (    Line line : lines) {
      itemIds.add(new WSUniverseItemsRevisionIDs(line.keyValues.get(0).value,line.keyValues.get(1).value));
    }
    ws.setItemsRevisionIDs(itemIds.toArray(new WSUniverseItemsRevisionIDs[itemIds.size()]));
    this.comitting=false;
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149011
Project: 149011
Buggy source:
@Override protected void okPressed(){
  name=text.getText();
  deactiveAllCellEditors();
  getValidationRules();
  super.okPressed();
}

Fixed version (ground truth):
@Override protected void okPressed(){
  name=text.getText();
  XpathSelectDialog.setContext(null);
  deactiveAllCellEditors();
  getValidationRules();
  super.okPressed();
}
Program: 149013
Project: 149013
Buggy source:
private String getValidationRules(){
  TableItem[] items=viewer.getViewer().getTable().getItems();
  StringBuffer sb=new StringBuffer();
  if (items.length > 0) {
    sb=sb.append("String_Node_Str" + "String_Node_Str" + text.getText() + "String_Node_Str");
    for (    TableItem item : items) {
      Line line=(Line)item.getData();
      sb=sb.append("String_Node_Str");
      String type=line.keyValues.get(0).value;
      String context=line.keyValues.get(1).value;
      String express=line.keyValues.get(2).value;
      String msg=line.keyValues.get(3).value;
      if (conceptName != null) {
        if (context.equals(conceptName)) {
          context=context.replaceAll(conceptName,"String_Node_Str");
        }
 else {
          context=context.replaceAll(conceptName + "String_Node_Str","String_Node_Str");
        }
      }
      sb=sb.append(context).append("String_Node_Str");
      sb=sb.append("String_Node_Str" + type.toLowerCase() + "String_Node_Str"+ express+ "String_Node_Str");
      sb=sb.append(msg);
      sb=sb.append("String_Node_Str" + type.toLowerCase() + "String_Node_Str");
      sb=sb.append("String_Node_Str");
    }
    sb=sb.append("String_Node_Str");
  }
  return pattern=sb.toString();
}

Fixed version (ground truth):
private String getValidationRules(){
  TableItem[] items=viewer.getViewer().getTable().getItems();
  StringBuffer sb=new StringBuffer();
  if (items.length > 0) {
    sb=sb.append("String_Node_Str" + "String_Node_Str" + text.getText() + "String_Node_Str");
    for (    TableItem item : items) {
      Line line=(Line)item.getData();
      sb=sb.append("String_Node_Str");
      String type=line.keyValues.get(0).value;
      String context=line.keyValues.get(1).value;
      String express=line.keyValues.get(2).value;
      express=express.replaceAll("String_Node_Str","String_Node_Str");
      String msg=line.keyValues.get(3).value;
      if (conceptName != null) {
        if (context.equals(conceptName)) {
          context=context.replaceAll(conceptName,"String_Node_Str");
        }
 else {
          context=context.replaceAll(conceptName + "String_Node_Str","String_Node_Str");
        }
      }
      sb=sb.append(context).append("String_Node_Str");
      sb=sb.append("String_Node_Str" + type.toLowerCase() + "String_Node_Str"+ express+ "String_Node_Str");
      sb=sb.append(msg);
      sb=sb.append("String_Node_Str" + type.toLowerCase() + "String_Node_Str");
      sb=sb.append("String_Node_Str");
    }
    sb=sb.append("String_Node_Str");
  }
  return pattern=sb.toString();
}
Program: 149015
Project: 149015
Buggy source:
private void setAnnotationActions(IMenuManager manager){
  manager.add(setAnnotationLabelAction);
  manager.add(setAnnotationDescriptionsAction);
  manager.add(setAnnotationForeignKeyAction);
  manager.add(setAnnotationForeignKeyInfoAction);
  manager.add(setAnnotationWriteAction);
  manager.add(setAnnotationHiddenAction);
  manager.add(setAnnotationSchematronAction);
  manager.add(setAnnotationSourceSystemAction);
  manager.add(setAnnotationTargetSystemsAction);
  manager.add(deleteValidationRule);
}

Fixed version (ground truth):
private void setAnnotationActions(IMenuManager manager){
  manager.add(setAnnotationLabelAction);
  manager.add(setAnnotationDescriptionsAction);
  manager.add(setAnnotationForeignKeyAction);
  manager.add(setAnnotationForeignKeyInfoAction);
  manager.add(setAnnotationWriteAction);
  manager.add(setAnnotationHiddenAction);
  manager.add(setAnnotationSourceSystemAction);
  manager.add(setAnnotationTargetSystemsAction);
  manager.add(deleteValidationRule);
}
Program: 149017
Project: 149017
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  dlg=new ValidationRuleExcpressDialog(composite.getShell(),"String_Node_Str",text.getText(),conceptName);
  dlg.setBlockOnOpen(true);
  dlg.create();
  int ret=dlg.open();
  if (ret == Window.OK) {
    text.setText(dlg.getExpression().replaceAll("String_Node_Str","String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  dlg=new ValidationRuleExcpressDialog(composite.getShell(),"String_Node_Str",text.getText(),conceptName);
  dlg.setBlockOnOpen(true);
  dlg.create();
  int ret=dlg.open();
  if (ret == Window.OK) {
    text.setText(dlg.getExpression());
  }
}
Program: 149018
Project: 149018
Buggy source:
private void create(){
  composite=toolkit.createComposite(parent,SWT.NO_FOCUS);
  composite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  GridLayout layout=new GridLayout(2,false);
  layout.marginWidth=0;
  layout.marginLeft=0;
  layout.marginTop=0;
  layout.marginHeight=0;
  layout.marginBottom=0;
  composite.setLayout(layout);
  text=toolkit.createText(composite,"String_Node_Str",SWT.BORDER | SWT.MULTI | SWT.LEFT);
  text.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  button=toolkit.createButton(composite,"String_Node_Str",SWT.PUSH);
  button.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false,1,1));
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      dlg=new ValidationRuleExcpressDialog(composite.getShell(),"String_Node_Str",text.getText(),conceptName);
      dlg.setBlockOnOpen(true);
      dlg.create();
      int ret=dlg.open();
      if (ret == Window.OK) {
        text.setText(dlg.getExpression().replaceAll("String_Node_Str","String_Node_Str"));
      }
    }
  }
);
  button.setImage(ImageCache.getCreatedImage(EImage.DOTS_BUTTON.getPath()));
  button.setToolTipText("String_Node_Str");
}

Fixed version (ground truth):
private void create(){
  composite=toolkit.createComposite(parent,SWT.NO_FOCUS);
  composite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  GridLayout layout=new GridLayout(2,false);
  layout.marginWidth=0;
  layout.marginLeft=0;
  layout.marginTop=0;
  layout.marginHeight=0;
  layout.marginBottom=0;
  composite.setLayout(layout);
  text=toolkit.createText(composite,"String_Node_Str",SWT.BORDER | SWT.MULTI | SWT.LEFT);
  text.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  button=toolkit.createButton(composite,"String_Node_Str",SWT.PUSH);
  button.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false,1,1));
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      dlg=new ValidationRuleExcpressDialog(composite.getShell(),"String_Node_Str",text.getText(),conceptName);
      dlg.setBlockOnOpen(true);
      dlg.create();
      int ret=dlg.open();
      if (ret == Window.OK) {
        text.setText(dlg.getExpression());
      }
    }
  }
);
  button.setImage(ImageCache.getCreatedImage(EImage.DOTS_BUTTON.getPath()));
  button.setToolTipText("String_Node_Str");
}
Program: 149019
Project: 149019
Buggy source:
private List<Line> parseRules(){
  List<Line> lines=new ArrayList<Line>();
  String context="String_Node_Str";
  String type="String_Node_Str";
  String express="String_Node_Str";
  String msg="String_Node_Str";
  Element e=null;
  try {
    e=Util.parse(pattern).getDocumentElement();
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
  if (e.getAttributes().getNamedItem("String_Node_Str") != null)   name=e.getAttributes().getNamedItem("String_Node_Str").getTextContent();
  text.setText("String_Node_Str".equals(name) ? "String_Node_Str" : name);
  NodeList rulelist=e.getElementsByTagName("String_Node_Str");
  for (int i=0; i < rulelist.getLength(); i++) {
    Node r=rulelist.item(i);
    context=r.getAttributes().getNamedItem("String_Node_Str").getTextContent();
    type=r.getChildNodes().item(0).getNodeName();
    express=r.getChildNodes().item(0).getAttributes().getNamedItem("String_Node_Str").getTextContent();
    msg=r.getChildNodes().item(0).getTextContent();
    Line l=new Line(columns,new String[]{type,context,express,msg});
    lines.add(l);
  }
  return lines;
}

Fixed version (ground truth):
private List<Line> parseRules(){
  List<Line> lines=new ArrayList<Line>();
  pattern=pattern.replaceAll("String_Node_Str","String_Node_Str");
  String context="String_Node_Str";
  String type="String_Node_Str";
  String express="String_Node_Str";
  String msg="String_Node_Str";
  Element e=null;
  try {
    e=Util.parse(pattern).getDocumentElement();
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
  if (e.getAttributes().getNamedItem("String_Node_Str") != null)   name=e.getAttributes().getNamedItem("String_Node_Str").getTextContent();
  text.setText("String_Node_Str".equals(name) ? "String_Node_Str" : name);
  NodeList rulelist=e.getElementsByTagName("String_Node_Str");
  for (int i=0; i < rulelist.getLength(); i++) {
    Node r=rulelist.item(i);
    context=r.getAttributes().getNamedItem("String_Node_Str").getTextContent();
    for (int j=0; j < r.getChildNodes().getLength(); j++) {
      if (r.getChildNodes().item(j).getNodeType() == Node.ELEMENT_NODE) {
        type=r.getChildNodes().item(j).getNodeName();
        express=r.getChildNodes().item(j).getAttributes().getNamedItem("String_Node_Str").getTextContent();
        msg=r.getChildNodes().item(j).getTextContent();
        break;
      }
    }
    Line l=new Line(columns,new String[]{type,context,express,msg});
    lines.add(l);
  }
  return lines;
}
Program: 149024
Project: 149024
Buggy source:
public boolean checkInCopyType(Object[] selectedObjs){
  for (  Object obj : selectedObjs) {
    if (obj instanceof XSDElementDeclaration)     continue;
 else     return false;
  }
  return true;
}

Fixed version (ground truth):
public static boolean checkInCopyType(Object[] selectedObjs){
  for (  Object obj : selectedObjs) {
    if (obj instanceof XSDElementDeclaration)     continue;
 else     return false;
  }
  return true;
}
Program: 149025
Project: 149025
Buggy source:
public XSDCopyConceptAction(DataModelMainPage page){
  super();
  this.page=page;
  setImageDescriptor(ImageCache.getImage(EImage.COPY.getPath()));
  setText("String_Node_Str");
  setToolTipText("String_Node_Str");
}

Fixed version (ground truth):
public XSDCopyConceptAction(DataModelMainPage page,boolean multi){
  super();
  if (multi)   displayName="String_Node_Str";
  this.page=page;
  setImageDescriptor(ImageCache.getImage(EImage.COPY.getPath()));
  setText(displayName);
  setToolTipText(displayName);
}
Program: 149026
Project: 149026
Buggy source:
public boolean checkInPasteType(){
  if (WorkbenchClipboard.getWorkbenchClipboard().getConcepts().size() <= 0)   return false;
  return true;
}

Fixed version (ground truth):
public boolean checkInPasteType(){
  if (WorkbenchClipboard.getWorkbenchClipboard().getConcepts().size() <= 0)   return false;
  conceptList=WorkbenchClipboard.getWorkbenchClipboard().getConcepts();
  int t=0;
  for (  XSDElementDeclaration ele : conceptList) {
    if (conceptList.get(t).getSchema() != null) {
      List<String> concepts=Util.getConcepts(conceptList.get(t).getSchema());
      if (concepts.contains(ele.getName()))       return true;
    }
    t++;
  }
  return false;
}
Program: 149027
Project: 149027
Buggy source:
public XSDPasteConceptAction(DataModelMainPage page){
  super(page);
  this.page=page;
  setImageDescriptor(ImageCache.getImage(EImage.PASTE.getPath()));
  setText("String_Node_Str");
  setToolTipText("String_Node_Str");
}

Fixed version (ground truth):
public XSDPasteConceptAction(DataModelMainPage page,boolean multi){
  super(page);
  this.page=page;
  if (multi)   displayName="String_Node_Str";
  setImageDescriptor(ImageCache.getImage(EImage.PASTE.getPath()));
  setText(displayName);
  setToolTipText("String_Node_Str");
}
Program: 149031
Project: 149031
Buggy source:
public SelectImportedModulesDialog(Shell parentShell,XSDSchema schema,TreeObject treeObj,String title){
  super(parentShell);
  this.shell=parentShell;
  this.treeObject=treeObj;
  this.title=title;
  this.xsdSchema=schema;
}

Fixed version (ground truth):
public SelectImportedModulesDialog(Shell parentShell,XSDSchema schema,TreeObject treeObj,String title){
  super(parentShell);
  this.shell=parentShell;
  this.treeObject=treeObj;
  this.title=title;
  this.xsdSchema=schema;
  String endpointIpAddress=treeObject.getEndpointIpAddress();
  if (endpointIpAddress != null && endpointIpAddress.length() > 0) {
    LOCAL_MDM_URL=endpointIpAddress + "String_Node_Str";
  }
}
Program: 149032
Project: 149032
Buggy source:
public IStatus doAction(){
  try {
    ((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXSDSchemaAsString();
    XSDElementDeclaration decl=xsdElem;
    if (decl == null) {
      ISelection selection=page.getTreeViewer().getSelection();
      decl=(XSDElementDeclaration)((IStructuredSelection)selection).getFirstElement();
    }
    Set<String> list=new HashSet<String>();
    Util.getForeingKeyInSchema(list,schema);
    if (list.contains(decl.getName())) {
      MessageDialog.openWarning(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + decl.getName() + "String_Node_Str");
      return Status.CANCEL_STATUS;
    }
    ArrayList<Object> objList=new ArrayList<Object>();
    IStructuredContentProvider provider=(IStructuredContentProvider)page.getTreeViewer().getContentProvider();
    Object[] objs=Util.getAllObject(page.getSite(),objList,provider);
    Util.deleteReference(decl,objs);
    XSDTypeDefinition current=decl.getTypeDefinition();
    schema.getContents().remove(decl);
    schema.update();
    xsdElem=null;
    page.refresh();
    page.markDirty();
  }
 catch (  Exception e) {
    e.printStackTrace();
    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 {
    ((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXSDSchemaAsString();
    XSDElementDeclaration decl=xsdElem;
    if (decl == null) {
      ISelection selection=page.getTreeViewer().getSelection();
      decl=(XSDElementDeclaration)((IStructuredSelection)selection).getFirstElement();
    }
    page.getXObject().getParent();
    Set<String> list=new HashSet<String>();
    Util.getForeingKeyInDataModel(list,page.getXObject().getParent());
    if (list.contains(decl.getName())) {
      MessageDialog.openWarning(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + decl.getName() + "String_Node_Str");
      return Status.CANCEL_STATUS;
    }
    ArrayList<Object> objList=new ArrayList<Object>();
    IStructuredContentProvider provider=(IStructuredContentProvider)page.getTreeViewer().getContentProvider();
    Object[] objs=Util.getAllObject(page.getSite(),objList,provider);
    Util.deleteReference(decl,objs);
    XSDTypeDefinition current=decl.getTypeDefinition();
    schema.getContents().remove(decl);
    schema.update();
    xsdElem=null;
    page.refresh();
    page.markDirty();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    return Status.CANCEL_STATUS;
  }
  return Status.OK_STATUS;
}