nus-yam/ex-repair huggingface dataset:
Program: 149166
Project: 149166
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  parent.getShell().setText("String_Node_Str");
  Composite composite=(Composite)super.createDialogArea(parent);
  composite.setBackground(composite.getDisplay().getSystemColor(SWT.COLOR_WHITE));
  GridLayout layout=(GridLayout)composite.getLayout();
  layout.numColumns=1;
  comboDataCluster=new LabelCombo(toolkit,composite,"String_Node_Str",SWT.BORDER,2);
  comboDataCluster.getCombo().setEditable(false);
  List<String> dcs=Util.getCachedXObjectsNameSet(this.xObject,TreeObject.DATA_CLUSTER);
  dcs.add(0,"String_Node_Str");
  comboDataCluster.getCombo().setItems(dcs.toArray(new String[dcs.size()]));
  if (xObject != null && xObject.getDisplayName() != null) {
    if (EXtentisObjects.DataCluster.getDisplayName().equalsIgnoreCase(xObject.getDisplayName())) {
      comboDataCluster.getCombo().select(0);
    }
 else {
      comboDataCluster.getCombo().setText(xObject.getDisplayName());
    }
  }
  fw=new FileSelectWidget(composite,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},comboDataCluster.getCombo().getText());
  comboDataCluster.getCombo().addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      if (comboDataCluster.getCombo().getText().length() > 0) {
        fw.getText().setText(comboDataCluster.getCombo().getText());
        fw.setFilename(comboDataCluster.getCombo().getText());
      }
    }
  }
);
  return composite;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  parent.getShell().setText("String_Node_Str");
  Composite composite=(Composite)super.createDialogArea(parent);
  composite.setBackground(composite.getDisplay().getSystemColor(SWT.COLOR_WHITE));
  GridLayout layout=(GridLayout)composite.getLayout();
  layout.numColumns=1;
  comboDataCluster=new LabelCombo(toolkit,composite,"String_Node_Str",SWT.BORDER,2);
  comboDataCluster.getCombo().setEditable(false);
  List<String> dcs=Util.getChildren(this.xObject.getServerRoot(),TreeObject.DATA_CLUSTER);
  dcs.add(0,"String_Node_Str");
  comboDataCluster.getCombo().setItems(dcs.toArray(new String[dcs.size()]));
  if (xObject != null && xObject.getDisplayName() != null) {
    if (EXtentisObjects.DataCluster.getDisplayName().equalsIgnoreCase(xObject.getDisplayName())) {
      comboDataCluster.getCombo().select(0);
    }
 else {
      comboDataCluster.getCombo().setText(xObject.getDisplayName());
    }
  }
  fw=new FileSelectWidget(composite,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},comboDataCluster.getCombo().getText());
  comboDataCluster.getCombo().addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      if (comboDataCluster.getCombo().getText().length() > 0) {
        fw.getText().setText(comboDataCluster.getCombo().getText());
        fw.setFilename(comboDataCluster.getCombo().getText());
      }
    }
  }
);
  return composite;
}
Program: 149170
Project: 149170
Buggy source:
public TreeObject findObject(int type,String name){
  TreeObject[] allchildren=this.getChildren();
  for (int i=0; i < allchildren.length; i++) {
    if (allchildren[i] instanceof TreeParent) {
      return ((TreeParent)allchildren[i]).findObject(type,name);
    }
    if ((allchildren[i].getType() == type) && (allchildren[i].getDisplayName().equals(name)))     return allchildren[i];
  }
  return null;
}

Fixed version (ground truth):
public TreeObject findObject(int type,String name){
  TreeObject[] allchildren=this.getChildren();
  TreeObject obj=null;
  for (int i=0; i < allchildren.length; i++) {
    if (allchildren[i] instanceof TreeParent) {
      obj=((TreeParent)allchildren[i]).findObject(type,name);
    }
 else     if ((allchildren[i].getType() == type) && (allchildren[i].getDisplayName().equals(name)))     obj=allchildren[i];
  }
  return obj;
}
Program: 149173
Project: 149173
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  parent.getShell().setText("String_Node_Str");
  Composite composite=(Composite)super.createDialogArea(parent);
  composite.setBackground(composite.getDisplay().getSystemColor(SWT.COLOR_WHITE));
  GridLayout layout=(GridLayout)composite.getLayout();
  layout.numColumns=1;
  comboDataCluster=new LabelCombo(toolkit,composite,"String_Node_Str",SWT.BORDER,2);
  comboDataCluster.getCombo().setEditable(false);
  List<String> dcs=Util.getCachedXObjectsNameSet(this.xObject,TreeObject.DATA_CLUSTER);
  dcs.add(0,"String_Node_Str");
  comboDataCluster.getCombo().setItems(dcs.toArray(new String[dcs.size()]));
  if (xObject != null && xObject.getDisplayName() != null) {
    if (EXtentisObjects.DataCluster.getDisplayName().equalsIgnoreCase(xObject.getDisplayName())) {
      comboDataCluster.getCombo().select(0);
    }
 else {
      comboDataCluster.getCombo().setText(xObject.getDisplayName());
    }
  }
  fw=new FileSelectWidget(composite,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},comboDataCluster.getCombo().getText());
  comboDataCluster.getCombo().addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      if (comboDataCluster.getCombo().getText().length() > 0) {
        fw.getText().setText(comboDataCluster.getCombo().getText());
        fw.setFilename(comboDataCluster.getCombo().getText());
      }
    }
  }
);
  return composite;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  parent.getShell().setText("String_Node_Str");
  Composite composite=(Composite)super.createDialogArea(parent);
  composite.setBackground(composite.getDisplay().getSystemColor(SWT.COLOR_WHITE));
  GridLayout layout=(GridLayout)composite.getLayout();
  layout.numColumns=1;
  comboDataCluster=new LabelCombo(toolkit,composite,"String_Node_Str",SWT.BORDER,2);
  comboDataCluster.getCombo().setEditable(false);
  List<String> dcs=Util.getChildren(this.xObject.getServerRoot(),TreeObject.DATA_CLUSTER);
  dcs.add(0,"String_Node_Str");
  comboDataCluster.getCombo().setItems(dcs.toArray(new String[dcs.size()]));
  if (xObject != null && xObject.getDisplayName() != null) {
    if (EXtentisObjects.DataCluster.getDisplayName().equalsIgnoreCase(xObject.getDisplayName())) {
      comboDataCluster.getCombo().select(0);
    }
 else {
      comboDataCluster.getCombo().setText(xObject.getDisplayName());
    }
  }
  fw=new FileSelectWidget(composite,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},comboDataCluster.getCombo().getText());
  comboDataCluster.getCombo().addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      if (comboDataCluster.getCombo().getText().length() > 0) {
        fw.getText().setText(comboDataCluster.getCombo().getText());
        fw.setFilename(comboDataCluster.getCombo().getText());
      }
    }
  }
);
  return composite;
}
Program: 149177
Project: 149177
Buggy source:
public TreeObject findObject(int type,String name){
  TreeObject[] allchildren=this.getChildren();
  for (int i=0; i < allchildren.length; i++) {
    if (allchildren[i] instanceof TreeParent) {
      return ((TreeParent)allchildren[i]).findObject(type,name);
    }
    if ((allchildren[i].getType() == type) && (allchildren[i].getDisplayName().equals(name)))     return allchildren[i];
  }
  return null;
}

Fixed version (ground truth):
public TreeObject findObject(int type,String name){
  TreeObject[] allchildren=this.getChildren();
  TreeObject obj=null;
  for (int i=0; i < allchildren.length; i++) {
    if (allchildren[i] instanceof TreeParent) {
      obj=((TreeParent)allchildren[i]).findObject(type,name);
    }
 else     if ((allchildren[i].getType() == type) && (allchildren[i].getDisplayName().equals(name)))     obj=allchildren[i];
  }
  return obj;
}
Program: 149178
Project: 149178
Buggy source:
/** 
 * @ejb.interface-method view-type = "service-endpoint"
 * @ejb.permission role-name = "authenticated" view-type = "service-endpoint"
 */
public WSString serviceAction(WSServiceAction wsServiceAction) throws RemoteException {
  org.apache.log4j.Category.getInstance(this.getClass()).debug("String_Node_Str" + wsServiceAction.getJndiName());
  try {
    Object service=Util.retrieveComponent(null,wsServiceAction.getJndiName());
    String result="String_Node_Str";
    if (WSServiceActionCode.EXECUTE.equals(wsServiceAction.getWsAction())) {
      result=(String)Util.getMethod(service,wsServiceAction.getMethodName()).invoke(service,new Object[]{wsServiceAction.getMethodParameters()});
    }
 else {
      if (WSServiceActionCode.START.equals(wsServiceAction.getWsAction())) {
        Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
 else       if (WSServiceActionCode.STOP.equals(wsServiceAction.getWsAction())) {
        Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
      result=(String)Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
    }
    return new WSString(result);
  }
 catch (  XtentisException e) {
    throw (new RemoteException(e.getLocalizedMessage()));
  }
catch (  Exception e) {
    throw new RemoteException((e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()));
  }
}

Fixed version (ground truth):
/** 
 * @ejb.interface-method view-type = "service-endpoint"
 * @ejb.permission role-name = "authenticated" view-type = "service-endpoint"
 */
public WSString serviceAction(WSServiceAction wsServiceAction) throws RemoteException {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + wsServiceAction.getJndiName());
  try {
    Object service=com.amalto.core.util.Util.retrieveComponent(null,wsServiceAction.getJndiName());
    String result="String_Node_Str";
    if (WSServiceActionCode.EXECUTE.equals(wsServiceAction.getWsAction())) {
      Method method=com.amalto.core.util.Util.getMethod(service,wsServiceAction.getMethodName());
      result=(String)method.invoke(service,wsServiceAction.getMethodParameters());
    }
 else {
      if (WSServiceActionCode.START.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
 else       if (WSServiceActionCode.STOP.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
      result=(String)com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
    }
    return new WSString(result);
  }
 catch (  com.amalto.core.util.XtentisException e) {
    e.printStackTrace();
    throw (new RemoteException(e.getLocalizedMessage()));
  }
catch (  Exception e) {
    e.printStackTrace();
    throw new RemoteException((e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()));
  }
}
Program: 149179
Project: 149179
Buggy source:
public WSString serviceAction(WSServiceAction wsServiceAction) throws RemoteException {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + wsServiceAction.getJndiName());
  try {
    Object service=com.amalto.core.util.Util.retrieveComponent(null,wsServiceAction.getJndiName());
    String result="String_Node_Str";
    if (WSServiceActionCode.EXECUTE.equals(wsServiceAction.getWsAction())) {
      result=(String)com.amalto.core.util.Util.getMethod(service,wsServiceAction.getMethodName()).invoke(service,new Object[]{wsServiceAction.getMethodParameters()});
    }
 else {
      if (WSServiceActionCode.START.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
 else       if (WSServiceActionCode.STOP.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
      result=(String)com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
    }
    return new WSString(result);
  }
 catch (  com.amalto.core.util.XtentisException e) {
    throw (new RemoteException(e.getLocalizedMessage()));
  }
catch (  Exception e) {
    throw new RemoteException((e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()));
  }
}

Fixed version (ground truth):
public WSString serviceAction(WSServiceAction wsServiceAction) throws RemoteException {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + wsServiceAction.getJndiName());
  try {
    Object service=com.amalto.core.util.Util.retrieveComponent(null,wsServiceAction.getJndiName());
    String result="String_Node_Str";
    if (WSServiceActionCode.EXECUTE.equals(wsServiceAction.getWsAction())) {
      Method method=com.amalto.core.util.Util.getMethod(service,wsServiceAction.getMethodName());
      result=(String)method.invoke(service,wsServiceAction.getMethodParameters());
    }
 else {
      if (WSServiceActionCode.START.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
 else       if (WSServiceActionCode.STOP.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
      result=(String)com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
    }
    return new WSString(result);
  }
 catch (  com.amalto.core.util.XtentisException e) {
    e.printStackTrace();
    throw (new RemoteException(e.getLocalizedMessage()));
  }
catch (  Exception e) {
    e.printStackTrace();
    throw new RemoteException((e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()));
  }
}
Program: 149180
Project: 149180
Buggy source:
/** 
 * @ejb.interface-method view-type = "service-endpoint"
 * @ejb.permission role-name = "authenticated" view-type = "service-endpoint"
 */
public WSString serviceAction(WSServiceAction wsServiceAction) throws RemoteException {
  org.apache.log4j.Category.getInstance(this.getClass()).debug("String_Node_Str" + wsServiceAction.getJndiName());
  try {
    Object service=Util.retrieveComponent(null,wsServiceAction.getJndiName());
    String result="String_Node_Str";
    if (WSServiceActionCode.EXECUTE.equals(wsServiceAction.getWsAction())) {
      result=(String)Util.getMethod(service,wsServiceAction.getMethodName()).invoke(service,new Object[]{wsServiceAction.getMethodParameters()});
    }
 else {
      if (WSServiceActionCode.START.equals(wsServiceAction.getWsAction())) {
        Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
 else       if (WSServiceActionCode.STOP.equals(wsServiceAction.getWsAction())) {
        Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
      result=(String)Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
    }
    return new WSString(result);
  }
 catch (  XtentisException e) {
    throw (new RemoteException(e.getLocalizedMessage()));
  }
catch (  Exception e) {
    throw new RemoteException((e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()));
  }
}

Fixed version (ground truth):
/** 
 * @ejb.interface-method view-type = "service-endpoint"
 * @ejb.permission role-name = "authenticated" view-type = "service-endpoint"
 */
public WSString serviceAction(WSServiceAction wsServiceAction) throws RemoteException {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + wsServiceAction.getJndiName());
  try {
    Object service=com.amalto.core.util.Util.retrieveComponent(null,wsServiceAction.getJndiName());
    String result="String_Node_Str";
    if (WSServiceActionCode.EXECUTE.equals(wsServiceAction.getWsAction())) {
      Method method=com.amalto.core.util.Util.getMethod(service,wsServiceAction.getMethodName());
      result=(String)method.invoke(service,wsServiceAction.getMethodParameters());
    }
 else {
      if (WSServiceActionCode.START.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
 else       if (WSServiceActionCode.STOP.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
      result=(String)com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
    }
    return new WSString(result);
  }
 catch (  com.amalto.core.util.XtentisException e) {
    e.printStackTrace();
    throw (new RemoteException(e.getLocalizedMessage()));
  }
catch (  Exception e) {
    e.printStackTrace();
    throw new RemoteException((e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()));
  }
}
Program: 149181
Project: 149181
Buggy source:
public WSString serviceAction(WSServiceAction wsServiceAction) throws RemoteException {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + wsServiceAction.getJndiName());
  try {
    Object service=com.amalto.core.util.Util.retrieveComponent(null,wsServiceAction.getJndiName());
    String result="String_Node_Str";
    if (WSServiceActionCode.EXECUTE.equals(wsServiceAction.getWsAction())) {
      result=(String)com.amalto.core.util.Util.getMethod(service,wsServiceAction.getMethodName()).invoke(service,new Object[]{wsServiceAction.getMethodParameters()});
    }
 else {
      if (WSServiceActionCode.START.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
 else       if (WSServiceActionCode.STOP.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
      result=(String)com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
    }
    return new WSString(result);
  }
 catch (  com.amalto.core.util.XtentisException e) {
    throw (new RemoteException(e.getLocalizedMessage()));
  }
catch (  Exception e) {
    throw new RemoteException((e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()));
  }
}

Fixed version (ground truth):
public WSString serviceAction(WSServiceAction wsServiceAction) throws RemoteException {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + wsServiceAction.getJndiName());
  try {
    Object service=com.amalto.core.util.Util.retrieveComponent(null,wsServiceAction.getJndiName());
    String result="String_Node_Str";
    if (WSServiceActionCode.EXECUTE.equals(wsServiceAction.getWsAction())) {
      Method method=com.amalto.core.util.Util.getMethod(service,wsServiceAction.getMethodName());
      result=(String)method.invoke(service,wsServiceAction.getMethodParameters());
    }
 else {
      if (WSServiceActionCode.START.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
 else       if (WSServiceActionCode.STOP.equals(wsServiceAction.getWsAction())) {
        com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
      }
      result=(String)com.amalto.core.util.Util.getMethod(service,"String_Node_Str").invoke(service,new Object[]{});
    }
    return new WSString(result);
  }
 catch (  com.amalto.core.util.XtentisException e) {
    e.printStackTrace();
    throw (new RemoteException(e.getLocalizedMessage()));
  }
catch (  Exception e) {
    e.printStackTrace();
    throw new RemoteException((e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()));
  }
}
Program: 149182
Project: 149182
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()) {
      xtentisObjectsRevisionIDs.add(new WSUniverseXtentisObjectsRevisionIDs(line.key,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>();
    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());
  }
}
Program: 149183
Project: 149183
Buggy source:
public Universe(String defaultReversionID) throws RemoteException {
  this.defaultReversionID=defaultReversionID;
  for (  String str : getPort().getObjectsForUniverses(new WSGetObjectsForUniverses(new String[]{"String_Node_Str"})).getStrings()) {
    xtentisObjectsList.add(new KeyValue(str,"String_Node_Str"));
  }
}

Fixed version (ground truth):
public Universe(String defaultReversionID) throws RemoteException {
  this.defaultReversionID=defaultReversionID;
  for (  String str : getPort().getObjectsForUniverses(new WSGetObjectsForUniverses(new String[]{"String_Node_Str"})).getStrings()) {
    String name=str;
    if (EXtentisObjects.Transformer.getName().equals(name)) {
      name=EXtentisObjects.Transformer.getDisplayName();
    }
    xtentisObjectsList.add(new KeyValue(name,"String_Node_Str"));
  }
}
Program: 149185
Project: 149185
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()) {
      xtentisObjectsRevisionIDs.add(new WSUniverseXtentisObjectsRevisionIDs(line.key,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>();
    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());
  }
}
Program: 149186
Project: 149186
Buggy source:
public Universe(String defaultReversionID) throws RemoteException {
  this.defaultReversionID=defaultReversionID;
  for (  String str : getPort().getObjectsForUniverses(new WSGetObjectsForUniverses(new String[]{"String_Node_Str"})).getStrings()) {
    xtentisObjectsList.add(new KeyValue(str,"String_Node_Str"));
  }
}

Fixed version (ground truth):
public Universe(String defaultReversionID) throws RemoteException {
  this.defaultReversionID=defaultReversionID;
  for (  String str : getPort().getObjectsForUniverses(new WSGetObjectsForUniverses(new String[]{"String_Node_Str"})).getStrings()) {
    String name=str;
    if (EXtentisObjects.Transformer.getName().equals(name)) {
      name=EXtentisObjects.Transformer.getDisplayName();
    }
    xtentisObjectsList.add(new KeyValue(name,"String_Node_Str"));
  }
}
Program: 149192
Project: 149192
Buggy source:
public void run(){
  IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
  List list=selection.toList();
  for (  Object obj : list) {
    if (obj instanceof XSDElementDeclaration) {
      if (Util.getParent(obj) == obj)       declList.add((XSDElementDeclaration)obj);
    }
  }
  AddBrowseItemsWizard wizard=new AddBrowseItemsWizard(page,list);
  WizardDialog dialog=new WizardDialog(page.getSite().getShell(),wizard);
  dialog.open();
  dialog.setBlockOnOpen(true);
}

Fixed version (ground truth):
public void run(){
  IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
  declList.clear();
  List list=selection.toList();
  for (  Object obj : list) {
    if (obj instanceof XSDElementDeclaration) {
      if (Util.getParent(obj) == obj)       declList.add((XSDElementDeclaration)obj);
    }
  }
  AddBrowseItemsWizard wizard=new AddBrowseItemsWizard(page,declList);
  WizardDialog dialog=new WizardDialog(page.getSite().getShell(),wizard);
  dialog.open();
}
Program: 149193
Project: 149193
Buggy source:
private void newBrowseItemView(String browseItem) throws RemoteException {
  for (  XSDElementDeclaration decl : declList) {
    String fullName=BROWSE_ITEMS + decl.getName();
    if (fullName.equals(browseItem)) {
      XtentisPort port=getXtentisPort();
      WSView view=new WSView();
      WSPutView wrap=new WSPutView();
      view.setName(browseItem);
      EList<XSDIdentityConstraintDefinition> idtylist=decl.getIdentityConstraintDefinitions();
      List<String> keys=new ArrayList<String>();
      for (      XSDIdentityConstraintDefinition idty : idtylist) {
        EList<XSDXPathDefinition> xpathList=idty.getFields();
        for (        XSDXPathDefinition path : xpathList) {
          String key=decl.getName();
          key+="String_Node_Str" + path.getValue();
          keys.add(key);
        }
      }
      view.setSearchableBusinessElements(keys.toArray(new String[]{}));
      view.setViewableBusinessElements(keys.toArray(new String[]{}));
      view.setDescription("String_Node_Str" + decl.getName() + "String_Node_Str");
      wrap.setWsView(view);
      WSDeleteView delView=new WSDeleteView();
      WSViewPK viewPk=new WSViewPK();
      viewPk.setPk(browseItem);
      delView.setWsViewPK(viewPk);
      port.deleteView(delView);
      port.putView(wrap);
    }
  }
}

Fixed version (ground truth):
private void newBrowseItemView(String browseItem) throws RemoteException {
  for (  XSDElementDeclaration decl : declList) {
    String fullName=BROWSE_ITEMS + decl.getName();
    if (fullName.equals(browseItem)) {
      XtentisPort port=getXtentisPort();
      WSView view=new WSView();
      WSPutView wrap=new WSPutView();
      view.setName(browseItem);
      EList<XSDIdentityConstraintDefinition> idtylist=decl.getIdentityConstraintDefinitions();
      List<String> keys=new ArrayList<String>();
      for (      XSDIdentityConstraintDefinition idty : idtylist) {
        EList<XSDXPathDefinition> xpathList=idty.getFields();
        for (        XSDXPathDefinition path : xpathList) {
          String key=decl.getName();
          key+="String_Node_Str" + path.getValue();
          keys.add(key);
        }
      }
      view.setSearchableBusinessElements(keys.toArray(new String[]{}));
      view.setViewableBusinessElements(keys.toArray(new String[]{}));
      view.setDescription("String_Node_Str" + decl.getName() + "String_Node_Str");
      wrap.setWsView(view);
      WSViewPK viewPk=new WSViewPK();
      viewPk.setPk(browseItem);
      WSDeleteView delView=new WSDeleteView();
      delView.setWsViewPK(viewPk);
      WSGetView getView=new WSGetView();
      getView.setWsViewPK(viewPk);
      try {
        port.getView(getView);
        port.deleteView(delView);
      }
 catch (      RemoteException ex) {
      }
      port.putView(wrap);
    }
  }
}
Program: 149194
Project: 149194
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  String name=(String)((IStructuredSelection)event.getSelection()).getFirstElement();
  refreshRoleView(name);
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  XSDElementDeclaration decl=(XSDElementDeclaration)((IStructuredSelection)event.getSelection()).getFirstElement();
  refreshRoleView(BROWSE_ITEMS + decl.getName());
  UpdateComplexViewButton(true);
}
Program: 149195
Project: 149195
Buggy source:
public Object[] getElements(Object inputElement){
  ArrayList<String> values=new ArrayList<String>();
  for (  XSDElementDeclaration decl : declList) {
    String name=decl.getName();
    name=BROWSE_ITEMS + name;
    values.add(name);
  }
  return values.toArray(new String[values.size()]);
}

Fixed version (ground truth):
public Object[] getElements(Object inputElement){
  ArrayList<XSDElementDeclaration> values=(ArrayList<XSDElementDeclaration>)inputElement;
  return values.toArray(new XSDElementDeclaration[values.size()]);
}
Program: 149196
Project: 149196
Buggy source:
public String getColumnText(Object element,int columnIndex){
  return element.toString();
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  return BROWSE_ITEMS + ((XSDElementDeclaration)element).getName();
}
Program: 149198
Project: 149198
Buggy source:
public void run(){
  IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
  List list=selection.toList();
  for (  Object obj : list) {
    if (obj instanceof XSDElementDeclaration) {
      if (Util.getParent(obj) == obj)       declList.add((XSDElementDeclaration)obj);
    }
  }
  AddBrowseItemsWizard wizard=new AddBrowseItemsWizard(page,list);
  WizardDialog dialog=new WizardDialog(page.getSite().getShell(),wizard);
  dialog.open();
  dialog.setBlockOnOpen(true);
}

Fixed version (ground truth):
public void run(){
  IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
  declList.clear();
  List list=selection.toList();
  for (  Object obj : list) {
    if (obj instanceof XSDElementDeclaration) {
      if (Util.getParent(obj) == obj)       declList.add((XSDElementDeclaration)obj);
    }
  }
  AddBrowseItemsWizard wizard=new AddBrowseItemsWizard(page,declList);
  WizardDialog dialog=new WizardDialog(page.getSite().getShell(),wizard);
  dialog.open();
}
Program: 149199
Project: 149199
Buggy source:
private void newBrowseItemView(String browseItem) throws RemoteException {
  for (  XSDElementDeclaration decl : declList) {
    String fullName=BROWSE_ITEMS + decl.getName();
    if (fullName.equals(browseItem)) {
      XtentisPort port=getXtentisPort();
      WSView view=new WSView();
      WSPutView wrap=new WSPutView();
      view.setName(browseItem);
      EList<XSDIdentityConstraintDefinition> idtylist=decl.getIdentityConstraintDefinitions();
      List<String> keys=new ArrayList<String>();
      for (      XSDIdentityConstraintDefinition idty : idtylist) {
        EList<XSDXPathDefinition> xpathList=idty.getFields();
        for (        XSDXPathDefinition path : xpathList) {
          String key=decl.getName();
          key+="String_Node_Str" + path.getValue();
          keys.add(key);
        }
      }
      view.setSearchableBusinessElements(keys.toArray(new String[]{}));
      view.setViewableBusinessElements(keys.toArray(new String[]{}));
      view.setDescription("String_Node_Str" + decl.getName() + "String_Node_Str");
      wrap.setWsView(view);
      WSDeleteView delView=new WSDeleteView();
      WSViewPK viewPk=new WSViewPK();
      viewPk.setPk(browseItem);
      delView.setWsViewPK(viewPk);
      port.deleteView(delView);
      port.putView(wrap);
    }
  }
}

Fixed version (ground truth):
private void newBrowseItemView(String browseItem) throws RemoteException {
  for (  XSDElementDeclaration decl : declList) {
    String fullName=BROWSE_ITEMS + decl.getName();
    if (fullName.equals(browseItem)) {
      XtentisPort port=getXtentisPort();
      WSView view=new WSView();
      WSPutView wrap=new WSPutView();
      view.setName(browseItem);
      EList<XSDIdentityConstraintDefinition> idtylist=decl.getIdentityConstraintDefinitions();
      List<String> keys=new ArrayList<String>();
      for (      XSDIdentityConstraintDefinition idty : idtylist) {
        EList<XSDXPathDefinition> xpathList=idty.getFields();
        for (        XSDXPathDefinition path : xpathList) {
          String key=decl.getName();
          key+="String_Node_Str" + path.getValue();
          keys.add(key);
        }
      }
      view.setSearchableBusinessElements(keys.toArray(new String[]{}));
      view.setViewableBusinessElements(keys.toArray(new String[]{}));
      view.setDescription("String_Node_Str" + decl.getName() + "String_Node_Str");
      wrap.setWsView(view);
      WSViewPK viewPk=new WSViewPK();
      viewPk.setPk(browseItem);
      WSDeleteView delView=new WSDeleteView();
      delView.setWsViewPK(viewPk);
      WSGetView getView=new WSGetView();
      getView.setWsViewPK(viewPk);
      try {
        port.getView(getView);
        port.deleteView(delView);
      }
 catch (      RemoteException ex) {
      }
      port.putView(wrap);
    }
  }
}
Program: 149200
Project: 149200
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  String name=(String)((IStructuredSelection)event.getSelection()).getFirstElement();
  refreshRoleView(name);
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  XSDElementDeclaration decl=(XSDElementDeclaration)((IStructuredSelection)event.getSelection()).getFirstElement();
  refreshRoleView(BROWSE_ITEMS + decl.getName());
  UpdateComplexViewButton(true);
}
Program: 149201
Project: 149201
Buggy source:
public Object[] getElements(Object inputElement){
  ArrayList<String> values=new ArrayList<String>();
  for (  XSDElementDeclaration decl : declList) {
    String name=decl.getName();
    name=BROWSE_ITEMS + name;
    values.add(name);
  }
  return values.toArray(new String[values.size()]);
}

Fixed version (ground truth):
public Object[] getElements(Object inputElement){
  ArrayList<XSDElementDeclaration> values=(ArrayList<XSDElementDeclaration>)inputElement;
  return values.toArray(new XSDElementDeclaration[values.size()]);
}
Program: 149202
Project: 149202
Buggy source:
public String getColumnText(Object element,int columnIndex){
  return element.toString();
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  return BROWSE_ITEMS + ((XSDElementDeclaration)element).getName();
}
Program: 149206
Project: 149206
Buggy source:
/** 
 * give the children of a node
 * @param id the id of the node in yui
 * @param nodeCount the internal count of nodes in yui tree
 * @param language
 * @return an array of TreeNode
 */
public TreeNode[] getChildren(int id,int nodeCount,String language,boolean foreignKey,int docIndex){
  return getChildrenWithMask(id,nodeCount,language,foreignKey,docIndex,false);
}

Fixed version (ground truth):
/** 
 * give the children of a node
 * @param id the id of the node in yui
 * @param nodeCount the internal count of nodes in yui tree
 * @param language
 * @return an array of TreeNode
 */
public TreeNode[] getChildren(int id,int nodeCount,String language,boolean foreignKey,int docIndex){
  return getChildrenWithKeyMask(id,nodeCount,language,foreignKey,docIndex,false);
}
Program: 149208
Project: 149208
Buggy source:
/** 
 * give the children of a node
 * @param id the id of the node in yui
 * @param nodeCount the internal count of nodes in yui tree
 * @param language
 * @return an array of TreeNode
 */
public TreeNode[] getChildren(int id,int nodeCount,String language,boolean foreignKey,int docIndex){
  return getChildrenWithMask(id,nodeCount,language,foreignKey,docIndex,false);
}

Fixed version (ground truth):
/** 
 * give the children of a node
 * @param id the id of the node in yui
 * @param nodeCount the internal count of nodes in yui tree
 * @param language
 * @return an array of TreeNode
 */
public TreeNode[] getChildren(int id,int nodeCount,String language,boolean foreignKey,int docIndex){
  return getChildrenWithKeyMask(id,nodeCount,language,foreignKey,docIndex,false);
}
Program: 149210
Project: 149210
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: 149213
Project: 149213
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: 149218
Project: 149218
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: 149220
Project: 149220
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: 149223
Project: 149223
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: 149226
Project: 149226
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();
  }
}