nus-yam/ex-repair huggingface dataset:
Program: 148799
Project: 148799
Buggy source:
public boolean isTypeDefinition(Object[] selectedObjs){
  boolean typeDefinition=true;
  for (  Object obj : selectedObjs) {
    if (!(obj instanceof XSDSimpleTypeDefinition) && !(obj instanceof XSDComplexTypeDefinition)) {
      typeDefinition=false;
      break;
    }
  }
  return typeDefinition;
}

Fixed version (ground truth):
public boolean isTypeDefinition(Object[] selectedObjs){
  boolean typeDefinition=true;
  boolean isAllComplexType=false;
  for (  Object obj : selectedObjs) {
    if (!(obj instanceof XSDSimpleTypeDefinition) && !(obj instanceof XSDComplexTypeDefinition)) {
      typeDefinition=false;
      break;
    }
 else     if (!(obj instanceof XSDComplexTypeDefinition))     isAllComplexType=true;
  }
  if (selectedObjs.length == 1)   isAllComplexType=true;
  return typeDefinition && isAllComplexType;
}
Program: 148800
Project: 148800
Buggy source:
public XSDDeleteTypeDefinition(DataModelMainPage page){
  super(page);
  setImageDescriptor(ImageCache.getImage(EImage.DELETE_OBJ.getPath()));
  setText("String_Node_Str");
  setToolTipText("String_Node_Str");
  setDescription(getToolTipText());
}

Fixed version (ground truth):
public XSDDeleteTypeDefinition(DataModelMainPage page,boolean isMulti){
  super(page);
  setImageDescriptor(ImageCache.getImage(EImage.DELETE_OBJ.getPath()));
  if (isMulti)   setText("String_Node_Str");
 else   setText("String_Node_Str");
  setToolTipText("String_Node_Str");
  setDescription(getToolTipText());
}
Program: 148807
Project: 148807
Buggy source:
public void drop(DropTargetEvent event){
  if (event.data instanceof TreeObject[])   if (((TreeObject[])event.data)[0].getType() == TreeObject.TRANSFORMER)   serviceParametersText.setText("String_Node_Str" + ((TreeObject[])event.data)[0].getDisplayName());
 else   serviceParametersText.setText(((TreeObject[])event.data)[0].getDisplayName());
}

Fixed version (ground truth):
public void drop(DropTargetEvent event){
  if (event.data instanceof TreeObject[])   if (((TreeObject[])event.data)[0].getType() == TreeObject.TRANSFORMER)   serviceParametersText.setText(serviceParametersText.getText().replace("String_Node_Str","String_Node_Str") + ((TreeObject[])event.data)[0].getDisplayName());
 else   serviceParametersText.setText(serviceParametersText.getText() + ((TreeObject[])event.data)[0].getDisplayName());
}
Program: 148809
Project: 148809
Buggy source:
private void createCompDropTarget(){
  DropTarget dropTarget=new DropTarget(serviceParametersText,DND.DROP_MOVE | DND.DROP_LINK);
  dropTarget.setTransfer(new TreeObjectTransfer[]{TreeObjectTransfer.getInstance()});
  dropTarget.addDropListener(new DropTargetAdapter(){
    public void dragEnter(    DropTargetEvent event){
    }
    public void dragLeave(    DropTargetEvent event){
    }
    public void dragOver(    DropTargetEvent event){
      event.feedback|=DND.FEEDBACK_EXPAND | DND.FEEDBACK_SCROLL;
    }
    public void drop(    DropTargetEvent event){
      if (event.data instanceof TreeObject[])       if (((TreeObject[])event.data)[0].getType() == TreeObject.TRANSFORMER)       serviceParametersText.setText("String_Node_Str" + ((TreeObject[])event.data)[0].getDisplayName());
 else       serviceParametersText.setText(((TreeObject[])event.data)[0].getDisplayName());
    }
  }
);
}

Fixed version (ground truth):
private void createCompDropTarget(){
  DropTarget dropTarget=new DropTarget(serviceParametersText,DND.DROP_MOVE | DND.DROP_LINK);
  dropTarget.setTransfer(new TreeObjectTransfer[]{TreeObjectTransfer.getInstance()});
  dropTarget.addDropListener(new DropTargetAdapter(){
    public void dragEnter(    DropTargetEvent event){
    }
    public void dragLeave(    DropTargetEvent event){
    }
    public void dragOver(    DropTargetEvent event){
      event.feedback|=DND.FEEDBACK_EXPAND | DND.FEEDBACK_SCROLL;
    }
    public void drop(    DropTargetEvent event){
      if (event.data instanceof TreeObject[])       if (((TreeObject[])event.data)[0].getType() == TreeObject.TRANSFORMER)       serviceParametersText.setText(serviceParametersText.getText().replace("String_Node_Str","String_Node_Str") + ((TreeObject[])event.data)[0].getDisplayName());
 else       serviceParametersText.setText(serviceParametersText.getText() + ((TreeObject[])event.data)[0].getDisplayName());
    }
  }
);
}
Program: 148813
Project: 148813
Buggy source:
public LabelText(FormToolkit toolkit,Composite parent,final String labelName){
  label=toolkit.createLabel(parent,labelName,SWT.NULL);
  label.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  text=toolkit.createText(parent,"String_Node_Str",SWT.BORDER | SWT.MULTI);
  text.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
}

Fixed version (ground truth):
public LabelText(FormToolkit toolkit,Composite parent,final String labelName){
  label=toolkit.createLabel(parent,labelName,SWT.NULL);
  label.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  text=toolkit.createText(parent,"String_Node_Str",SWT.BORDER | SWT.MULTI);
  text.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  Util.createCompDropTarget(text);
}
Program: 148815
Project: 148815
Buggy source:
public void drop(DropTargetEvent event){
  Control control=((DropTarget)event.widget).getControl();
  if ((control instanceof List) && ((event.operations & DND.DROP_COPY) == DND.DROP_COPY))   if (TextTransfer.getInstance().isSupportedType(event.currentDataType))   if (!Arrays.asList(((List)control).getItems()).contains(event.data)) {
    ((List)control).add((String)event.data);
    RoutingRuleMainPage.this.markDirtyWithoutCommit();
  }
}

Fixed version (ground truth):
public void drop(DropTargetEvent event){
  if (event.data instanceof TreeObject[])   if (((TreeObject[])event.data)[0].getType() == TreeObject.TRANSFORMER)   serviceParametersText.setText("String_Node_Str" + ((TreeObject[])event.data)[0].getDisplayName());
 else   serviceParametersText.setText(((TreeObject[])event.data)[0].getDisplayName());
}
Program: 148816
Project: 148816
Buggy source:
public void dragEnter(DropTargetEvent event){
  if ((event.operations & DND.DROP_COPY) == DND.DROP_COPY)   event.detail=DND.DROP_COPY;
 else   if ((event.operations & DND.DROP_MOVE) == DND.DROP_MOVE)   event.detail=DND.DROP_MOVE;
 else   event.detail=DND.DROP_NONE;
}

Fixed version (ground truth):
public void dragEnter(DropTargetEvent event){
}
Program: 148818
Project: 148818
Buggy source:
public void dragOver(DropTargetEvent event){
}

Fixed version (ground truth):
public void dragOver(DropTargetEvent event){
  event.feedback|=DND.FEEDBACK_EXPAND | DND.FEEDBACK_SCROLL;
}
Program: 148824
Project: 148824
Buggy source:
public LabelText(FormToolkit toolkit,Composite parent,final String labelName){
  label=toolkit.createLabel(parent,labelName,SWT.NULL);
  label.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  text=toolkit.createText(parent,"String_Node_Str",SWT.BORDER | SWT.MULTI);
  text.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  Util.createCompDropTarget(text);
}

Fixed version (ground truth):
public LabelText(FormToolkit toolkit,Composite parent,final String labelName){
  label=toolkit.createLabel(parent,labelName,SWT.NULL);
  label.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  text=toolkit.createText(parent,"String_Node_Str",SWT.BORDER | SWT.MULTI);
  text.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
}
Program: 148829
Project: 148829
Buggy source:
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e){
}

Fixed version (ground truth):
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e){
  for (int i=0; i < types.size(); i++) {
    XSDComplexTypeDefinition type=types.get(i);
    XSDParticleImpl partCnt=null;
    if (typeNames.get(typeNames.indexOf(typeNameText.getText())).equalsIgnoreCase(type.getName()))     partCnt=(XSDParticleImpl)type.getContent();
    if (partCnt != null) {
      XSDModelGroupImpl mdlGrp=(XSDModelGroupImpl)partCnt.getTerm();
      XSDCompositor typeComposite=mdlGrp.getCompositor();
      if (typeComposite.equals(XSDCompositor.SEQUENCE_LITERAL))       setSequence();
 else       if (typeComposite.equals(XSDCompositor.ALL_LITERAL))       setAll();
 else       if (typeComposite.equals(XSDCompositor.CHOICE_LITERAL))       setChoice();
    }
  }
}
Program: 148834
Project: 148834
Buggy source:
protected Control createDialogArea(Composite parent){
  final Composite composite=(Composite)super.createDialogArea(parent);
  if (caller instanceof XSDNewComplexTypeDefinition) {
    parent.getShell().setText("String_Node_Str");
    conceptPanel=new ConceptComposite(composite,false,types,true);
  }
 else {
    if (isXSDModelGroup)     parent.getShell().setText("String_Node_Str");
 else     parent.getShell().setText("String_Node_Str");
    conceptPanel=new ConceptComposite(composite,false,types,false);
  }
  conceptPanel.getTypeCombo().addModifyListener(this);
  return conceptPanel.getComposite();
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  final Composite composite=(Composite)super.createDialogArea(parent);
  if (caller instanceof XSDNewComplexTypeDefinition) {
    parent.getShell().setText("String_Node_Str");
    conceptPanel=new ConceptComposite(composite,false,types,true);
  }
 else {
    if (isXSDModelGroup)     parent.getShell().setText("String_Node_Str");
 else     parent.getShell().setText("String_Node_Str");
    conceptPanel=new ConceptComposite(composite,false,types,false);
    conceptPanel.setText(typeName);
    if (typeComposite != null) {
      if (typeComposite.equals(XSDCompositor.ALL_LITERAL))       conceptPanel.setAll();
 else       if (typeComposite.equals(XSDCompositor.CHOICE_LITERAL))       conceptPanel.setChoice();
      if (typeComposite.equals(XSDCompositor.SEQUENCE_LITERAL))       conceptPanel.setSequence();
    }
  }
  conceptPanel.getTypeCombo().addModifyListener(this);
  return conceptPanel.getComposite();
}
Program: 148835
Project: 148835
Buggy source:
/** 
 * @param parentShell
 * @param isXSDModelGroup 
 */
public ComplexTypeInputDialog(SelectionListener caller,Shell parentShell,XSDSchema schema,List<XSDComplexTypeDefinition> types,boolean isXSDModelGroup){
  super(parentShell);
  this.caller=caller;
  this.types=types;
  this.isXSDModelGroup=isXSDModelGroup;
  xsdSchema=schema;
}

Fixed version (ground truth):
/** 
 * @param parentShell
 * @param isXSDModelGroup 
 */
public ComplexTypeInputDialog(SelectionListener caller,Shell parentShell,XSDSchema schema,XSDTypeDefinition typeDefinition,List<XSDComplexTypeDefinition> types,boolean isXSDModelGroup){
  super(parentShell);
  this.caller=caller;
  this.types=types;
  this.isXSDModelGroup=isXSDModelGroup;
  xsdSchema=schema;
  if (typeDefinition != null) {
    if (typeDefinition instanceof XSDComplexTypeDefinition) {
      if (typeDefinition.getName() != null)       this.typeName=typeDefinition.getName();
      XSDComplexTypeDefinition complexType=(XSDComplexTypeDefinition)typeDefinition;
      XSDParticleImpl partCnt=(XSDParticleImpl)complexType.getContent();
      XSDModelGroupImpl mdlGrp=(XSDModelGroupImpl)partCnt.getTerm();
      typeComposite=mdlGrp.getCompositor();
    }
  }
}
Program: 148838
Project: 148838
Buggy source:
/** 
 * Marks the page as dirty
 */
public void markDirty(){
  topFormPart.markDirty();
}

Fixed version (ground truth):
/** 
 * Marks the page as dirty
 */
public void markDirty(){
  topFormPart.markDirty();
  commitChanges();
}
Program: 148839
Project: 148839
Buggy source:
public void run(){
  try {
    super.run();
    WSUniversePK[] universePKs=null;
    try {
      XtentisPort port=view.getPort();
      if (port != null)       universePKs=port.getUniversePKs(new WSGetUniversePKs("String_Node_Str")).getWsUniversePK();
    }
 catch (    RemoteException e) {
      e.printStackTrace();
    }
    universes=universePKs;
    dialog=new LoginDialog(this,view.getSite().getShell(),IConstants.TALEND + "String_Node_Str",universes);
    dialog.setBlockOnOpen(true);
    dialog.open();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    try {
      universes=new ArrayList<WSUniversePK>();
      WSUniversePK[] universePKs=null;
      List<XtentisPort> ports=view.getPorts();
      if (ports != null) {
        WSUniversePK[] temp=null;
        for (Iterator iterator=ports.iterator(); iterator.hasNext(); ) {
          XtentisPort port=(XtentisPort)iterator.next();
          universePKs=port.getUniversePKs(new WSGetUniversePKs("String_Node_Str")).getWsUniversePK();
          CollectionUtils.addAll(universes,universePKs);
        }
      }
    }
 catch (    RemoteException e) {
      e.printStackTrace();
    }
    dialog=new LoginDialog(this,view.getSite().getShell(),IConstants.TALEND + "String_Node_Str",universes);
    dialog.setBlockOnOpen(true);
    dialog.open();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 148841
Project: 148841
Buggy source:
/** 
 * @param parentShell
 */
public LoginDialog(SelectionListener caller,Shell parentShell,String title,WSUniversePK[] universes){
  super(parentShell);
  this.caller=caller;
  this.title=title;
  this.universes=universes;
  setDefaultImage(ImageCache.getCreatedImage(EImage.TALEND_PICTO.getPath()));
}

Fixed version (ground truth):
/** 
 * @param parentShell
 */
public LoginDialog(SelectionListener caller,Shell parentShell,String title,List<WSUniversePK> universes){
  super(parentShell);
  this.caller=caller;
  this.title=title;
  this.universes=universes;
  setDefaultImage(ImageCache.getCreatedImage(EImage.TALEND_PICTO.getPath()));
}
Program: 148842
Project: 148842
Buggy source:
public void initServerTreeParent(String url,String username,String password,String universe){
  TreeParent serverRoot=new TreeParent(url,null,TreeObject._SERVER_,url,("String_Node_Str".equals(universe) ? "String_Node_Str" : universe + "String_Node_Str") + username + "String_Node_Str"+ (password == null ? "String_Node_Str" : password));
  UserInfo user=new UserInfo();
  WSUniverse wUuniverse=null;
  XtentisPort port;
  try {
    port=Util.getPort(new URL(url),universe,username,password);
    wUuniverse=port.getCurrentUniverse(new WSGetCurrentUniverse());
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
  }
catch (  XtentisException e) {
    e.printStackTrace();
  }
catch (  RemoteException e) {
    e.printStackTrace();
  }
  user.setUsername(username);
  user.setPassword(password);
  user.setServerUrl(url);
  user.setUniverse(universe);
  user.setWsUuniverse(wUuniverse);
  serverRoot.setUser(user);
  if ("String_Node_Str".equalsIgnoreCase(universe))   universe="String_Node_Str";
  serverRoot.setDisplayName(url + "String_Node_Str" + universe+ "String_Node_Str"+ username);
  TreeObject obj=new TreeObject("String_Node_Str",serverRoot,TreeObject._UNVISIBLE,serverRoot.getWsKey(),serverRoot.getWsObject());
  TreeParent invisibleRoot=getTreeContentProvider().getInvisibleRoot();
  invisibleRoot.addChild(serverRoot);
  getViewer().refresh();
}

Fixed version (ground truth):
public void initServerTreeParent(String url,String username,String password,String universe){
  TreeParent serverRoot=new TreeParent(url,null,TreeObject._SERVER_,url,("String_Node_Str".equals(universe) ? "String_Node_Str" : universe + "String_Node_Str") + username + "String_Node_Str"+ (password == null ? "String_Node_Str" : password));
  UserInfo user=new UserInfo();
  XtentisPort port;
  try {
    port=Util.getPort(new URL(url),universe,username,password);
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
  }
catch (  XtentisException e) {
    e.printStackTrace();
  }
  user.setUsername(username);
  user.setPassword(password);
  user.setServerUrl(url);
  user.setUniverse(universe);
  serverRoot.setUser(user);
  if ("String_Node_Str".equalsIgnoreCase(universe))   universe="String_Node_Str";
  serverRoot.setDisplayName(url + "String_Node_Str" + universe+ "String_Node_Str"+ username);
  TreeObject obj=new TreeObject("String_Node_Str",serverRoot,TreeObject._UNVISIBLE,serverRoot.getWsKey(),serverRoot.getWsObject());
  TreeParent invisibleRoot=getTreeContentProvider().getInvisibleRoot();
  invisibleRoot.addChild(serverRoot);
  getViewer().refresh();
}
Program: 148845
Project: 148845
Buggy source:
protected void refreshData(){
  try {
    if (this.comitting)     return;
    this.refreshing=true;
    WSTransformerV2 wsTransformer=(WSTransformerV2)(getXObject().getWsObject());
    descriptionText.setText(wsTransformer.getDescription() == null ? "String_Node_Str" : wsTransformer.getDescription());
    stepsList.removeAll();
    WSTransformerProcessStep[] specs=wsTransformer.getProcessSteps();
    if (specs != null) {
      for (int i=0; i < specs.length; i++) {
        stepsList.add(specs[i].getDescription());
      }
    }
    stepsList.select(currentPlugin);
    if (stepsList.getItemCount() > 0 && stepsList.getSelectionIndex() == -1) {
      refreshStep(0);
    }
 else {
      refreshStep(stepsList.getSelectionIndex());
    }
    stepsList.forceFocus();
    this.refreshing=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 refreshData(){
  try {
    if (this.comitting)     return;
    this.refreshing=true;
    WSTransformerV2 wsTransformer=(WSTransformerV2)(getXObject().getWsObject());
    desAntionComposite.getTextWidget().setText(wsTransformer.getDescription() == null ? "String_Node_Str" : wsTransformer.getDescription());
    stepsList.removeAll();
    WSTransformerProcessStep[] specs=wsTransformer.getProcessSteps();
    if (specs != null) {
      for (int i=0; i < specs.length; i++) {
        stepsList.add(specs[i].getDescription());
      }
    }
    stepsList.select(currentPlugin);
    if (stepsList.getItemCount() > 0 && stepsList.getSelectionIndex() == -1) {
      refreshStep(0);
    }
 else {
      refreshStep(stepsList.getSelectionIndex());
    }
    stepsList.forceFocus();
    this.refreshing=false;
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 148847
Project: 148847
Buggy source:
public void modifyText(ModifyEvent e){
  if (refreshing)   return;
  TransformerMainPage.this.comitting=true;
  transformer.setDescription(descriptionText.getText());
  TransformerMainPage.this.comitting=false;
  markDirtyWithoutCommit();
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  if (refreshing)   return;
  TransformerMainPage.this.comitting=true;
  transformer.setDescription(desAntionComposite.getText());
  TransformerMainPage.this.comitting=false;
  markDirtyWithoutCommit();
}
Program: 148848
Project: 148848
Buggy source:
private void writeString(String outputStr,String filename) throws Exception {
  File f=new File(exportFolder + "String_Node_Str" + filename);
  if (!f.getParentFile().getParentFile().exists()) {
    f.getParentFile().getParentFile().mkdir();
  }
  if (!f.getParentFile().exists()) {
    f.getParentFile().mkdir();
  }
  FileWriter fo=new FileWriter(exportFolder + "String_Node_Str" + filename);
  fo.write(outputStr);
  fo.flush();
  fo.close();
}

Fixed version (ground truth):
private void writeString(String outputStr,String filename){
  try {
    File f=new File(exportFolder + "String_Node_Str" + filename);
    if (!f.getParentFile().getParentFile().exists()) {
      f.getParentFile().getParentFile().mkdir();
    }
    if (!f.getParentFile().exists()) {
      f.getParentFile().mkdir();
    }
    FileWriter fo=new FileWriter(exportFolder + "String_Node_Str" + filename);
    fo.write(outputStr);
    fo.flush();
    fo.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 148849
Project: 148849
Buggy source:
public void run(){
  try {
    super.run();
    universes=new ArrayList<WSUniversePK>();
    WSUniversePK[] universePKs=null;
    List<XtentisPort> ports=view.getPorts();
    if (ports != null) {
      for (Iterator iterator=ports.iterator(); iterator.hasNext(); ) {
        XtentisPort port=(XtentisPort)iterator.next();
        universePKs=port.getUniversePKs(new WSGetUniversePKs("String_Node_Str")).getWsUniversePK();
        if (universePKs != null && universePKs.length > 0)         CollectionUtils.addAll(universes,universePKs);
      }
    }
    dialog=new LoginDialog(this,view.getSite().getShell(),IConstants.TALEND + "String_Node_Str",universes);
    dialog.setBlockOnOpen(true);
    dialog.open();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    if (Util.IsEnterPrise()) {
      universes=new ArrayList<WSUniversePK>();
      WSUniversePK[] universePKs=null;
      List<XtentisPort> ports=view.getPorts();
      if (ports != null) {
        for (Iterator iterator=ports.iterator(); iterator.hasNext(); ) {
          XtentisPort port=(XtentisPort)iterator.next();
          universePKs=port.getUniversePKs(new WSGetUniversePKs("String_Node_Str")).getWsUniversePK();
          if (universePKs != null && universePKs.length > 0)           CollectionUtils.addAll(universes,universePKs);
        }
      }
    }
    dialog=new LoginDialog(this,view.getSite().getShell(),IConstants.TALEND + "String_Node_Str",universes);
    dialog.setBlockOnOpen(true);
    dialog.open();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 148851
Project: 148851
Buggy source:
public ImportItemsWizard(IStructuredSelection sel,ServerView view){
  this.sel=sel;
  this.view=view;
  serverRoot=((TreeObject)sel.getFirstElement()).getServerRoot();
}

Fixed version (ground truth):
public ImportItemsWizard(IStructuredSelection sel,ServerView view){
  this.sel=sel;
  this.view=view;
  serverRoot=((TreeObject)sel.getFirstElement()).getServerRoot();
  try {
    port=Util.getPort((TreeObject)sel.getFirstElement());
  }
 catch (  XtentisException e3) {
    e3.printStackTrace();
  }
}
Program: 148856
Project: 148856
Buggy source:
@Override public void keyPressed(KeyEvent e){
}

Fixed version (ground truth):
public void keyPressed(KeyEvent e){
}
Program: 148860
Project: 148860
Buggy source:
private boolean checkServer(Element root){
  List properties=root.elements("String_Node_Str");
  for (Iterator iterator=properties.iterator(); iterator.hasNext(); ) {
    Element ele=(Element)iterator.next();
    if (ele.element("String_Node_Str").getText().equals(endpointsCombo.getText()) && ele.element("String_Node_Str").getText().equals(userText.getText()))     return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean checkServer(Element root){
  List properties=root.elements("String_Node_Str");
  for (Iterator iterator=properties.iterator(); iterator.hasNext(); ) {
    Element ele=(Element)iterator.next();
    if (ele.element("String_Node_Str").getText().equals(endpointsCombo.getText()) && ele.element("String_Node_Str").getText().equals(userText.getText()) && ele.element("String_Node_Str").getText().equals(universeCombo.getText()))     return true;
  }
  return false;
}
Program: 148861
Project: 148861
Buggy source:
private void deleteReserved(String url,String user){
  SAXReader reader=new SAXReader();
  OutputFormat format=OutputFormat.createPrettyPrint();
  format.setEncoding("String_Node_Str");
  File file=new File(f);
  if (file.exists()) {
    Document logininfoDocument=null;
    try {
      logininfoDocument=reader.read(file);
    }
 catch (    DocumentException e) {
      e.printStackTrace();
    }
    Element root=logininfoDocument.getRootElement();
    deleteServer(root,url,user);
    try {
      XMLWriter writer=new XMLWriter(new FileWriter(f));
      writer.write(logininfoDocument);
      writer.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void deleteReserved(String url,String user,String universe){
  SAXReader reader=new SAXReader();
  OutputFormat format=OutputFormat.createPrettyPrint();
  format.setEncoding("String_Node_Str");
  File file=new File(f);
  if (file.exists()) {
    Document logininfoDocument=null;
    try {
      logininfoDocument=reader.read(file);
    }
 catch (    DocumentException e) {
      e.printStackTrace();
    }
    Element root=logininfoDocument.getRootElement();
    deleteServer(root,url,user,universe);
    try {
      XMLWriter writer=new XMLWriter(new FileWriter(f));
      writer.write(logininfoDocument);
      writer.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}
Program: 148862
Project: 148862
Buggy source:
private void deleteServer(Element root,String url,String user){
  java.util.List properties=root.elements("String_Node_Str");
  for (Iterator iterator=properties.iterator(); iterator.hasNext(); ) {
    Element ele=(Element)iterator.next();
    if (ele.element("String_Node_Str").getText().equals(url) && ele.element("String_Node_Str").getText().equals(user))     root.remove(ele);
  }
}

Fixed version (ground truth):
private void deleteServer(Element root,String url,String user,String universe){
  java.util.List properties=root.elements("String_Node_Str");
  for (Iterator iterator=properties.iterator(); iterator.hasNext(); ) {
    Element ele=(Element)iterator.next();
    if (ele.element("String_Node_Str").getText().equals(url) && ele.element("String_Node_Str").getText().equals(user) && ele.element("String_Node_Str").getText().equals(universe))     root.remove(ele);
  }
}
Program: 148865
Project: 148865
Buggy source:
public void run(){
  try {
    super.run();
    dialog=new LoginDialog(this,view.getSite().getShell(),IConstants.TALEND + "String_Node_Str");
    dialog.setBlockOnOpen(true);
    dialog.open();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    WSUniversePK[] universePKs=null;
    try {
      XtentisPort port=view.getPort();
      if (port != null)       universePKs=port.getUniversePKs(new WSGetUniversePKs("String_Node_Str")).getWsUniversePK();
    }
 catch (    RemoteException e) {
      e.printStackTrace();
    }
    universes=universePKs;
    dialog=new LoginDialog(this,view.getSite().getShell(),IConstants.TALEND + "String_Node_Str",universes);
    dialog.setBlockOnOpen(true);
    dialog.open();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 148867
Project: 148867
Buggy source:
/** 
 * @param parentShell
 */
public LoginDialog(SelectionListener caller,Shell parentShell,String title){
  super(parentShell);
  this.caller=caller;
  this.title=title;
  setDefaultImage(ImageCache.getCreatedImage(EImage.TALEND_PICTO.getPath()));
}

Fixed version (ground truth):
/** 
 * @param parentShell
 */
public LoginDialog(SelectionListener caller,Shell parentShell,String title,WSUniversePK[] universes){
  super(parentShell);
  this.caller=caller;
  this.title=title;
  this.universes=universes;
  setDefaultImage(ImageCache.getCreatedImage(EImage.TALEND_PICTO.getPath()));
}
Program: 148868
Project: 148868
Buggy source:
public TreeParent getServerRoot(){
  if (this.serverRoot == null && this instanceof TreeParent)   return (TreeParent)this;
  return serverRoot;
}

Fixed version (ground truth):
public TreeParent getServerRoot(){
  if (this.serverRoot == null) {
    if (this.type == TreeObject._SERVER_)     return (TreeParent)this;
 else     if (this.type == TreeObject._ROOT_)     if (((TreeParent)this).getChildren().length > 0)     return (TreeParent)((TreeParent)this).getChildren()[0];
  }
  return serverRoot;
}
Program: 148869
Project: 148869
Buggy source:
public void initView(){
  SAXReader reader=new SAXReader();
  OutputFormat format=OutputFormat.createPrettyPrint();
  format.setEncoding("String_Node_Str");
  File file=new File(f);
  if (file.exists()) {
    Document logininfoDocument=null;
    try {
      logininfoDocument=reader.read(file);
    }
 catch (    DocumentException e) {
      e.printStackTrace();
    }
    Element root=logininfoDocument.getRootElement();
    for (Iterator i=root.elementIterator("String_Node_Str"); i.hasNext(); ) {
      Element server=(Element)i.next();
      String url=server.selectSingleNode("String_Node_Str").getText();
      String user=server.selectSingleNode("String_Node_Str").getText();
      String password=PasswordUtil.decryptPassword(server.selectSingleNode("String_Node_Str").getText());
      String universe=server.selectSingleNode("String_Node_Str").getText();
      if (!("String_Node_Str".equalsIgnoreCase(url) || "String_Node_Str".equalsIgnoreCase(user) || "String_Node_Str".equalsIgnoreCase(password)))       initServerTree(url,user,password,universe);
    }
  }
}

Fixed version (ground truth):
public void initView(){
  SAXReader reader=new SAXReader();
  OutputFormat format=OutputFormat.createPrettyPrint();
  format.setEncoding("String_Node_Str");
  File file=new File(f);
  if (file.exists()) {
    Document logininfoDocument=null;
    try {
      logininfoDocument=reader.read(file);
    }
 catch (    DocumentException e) {
      e.printStackTrace();
    }
    Element root=logininfoDocument.getRootElement();
    for (Iterator i=root.elementIterator("String_Node_Str"); i.hasNext(); ) {
      Element server=(Element)i.next();
      String url=server.selectSingleNode("String_Node_Str").getText();
      String user=server.selectSingleNode("String_Node_Str").getText();
      String password=PasswordUtil.decryptPassword(server.selectSingleNode("String_Node_Str").getText());
      String universe=server.selectSingleNode("String_Node_Str").getText();
      if (!("String_Node_Str".equalsIgnoreCase(url) || "String_Node_Str".equalsIgnoreCase(user) || "String_Node_Str".equalsIgnoreCase(password)))       initServerTreeParent(url,user,password,universe);
    }
  }
}
Program: 148870
Project: 148870
Buggy source:
public void initServerTreeParent(String url,String username,String password,String universe){
  TreeParent serverRoot=new TreeParent(url,null,TreeObject._SERVER_,url,("String_Node_Str".equals(universe) ? "String_Node_Str" : universe + "String_Node_Str") + username + "String_Node_Str"+ (password == null ? "String_Node_Str" : password));
  TreeParent invisibleRoot=getTreeContentProvider().getInvisibleRoot();
  serverRoot.addChild(new TreeObject());
  invisibleRoot.addChild(serverRoot);
  getViewer().refresh();
}

Fixed version (ground truth):
public void initServerTreeParent(String url,String username,String password,String universe){
  TreeParent serverRoot=new TreeParent(url,null,TreeObject._SERVER_,url,("String_Node_Str".equals(universe) ? "String_Node_Str" : universe + "String_Node_Str") + username + "String_Node_Str"+ (password == null ? "String_Node_Str" : password));
  UserInfo user=new UserInfo();
  WSUniverse wUuniverse=null;
  XtentisPort port;
  try {
    port=Util.getPort(new URL(url),universe,username,password);
    wUuniverse=port.getCurrentUniverse(new WSGetCurrentUniverse());
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
  }
catch (  XtentisException e) {
    e.printStackTrace();
  }
catch (  RemoteException e) {
    e.printStackTrace();
  }
  user.setUsername(username);
  user.setPassword(password);
  user.setServerUrl(url);
  user.setUniverse(universe);
  user.setWsUuniverse(wUuniverse);
  serverRoot.setUser(user);
  if ("String_Node_Str".equalsIgnoreCase(universe))   universe="String_Node_Str";
  serverRoot.setDisplayName(url + "String_Node_Str" + universe+ "String_Node_Str"+ username);
  TreeObject obj=new TreeObject("String_Node_Str",serverRoot,TreeObject._UNVISIBLE,serverRoot.getWsKey(),serverRoot.getWsObject());
  TreeParent invisibleRoot=getTreeContentProvider().getInvisibleRoot();
  invisibleRoot.addChild(serverRoot);
  getViewer().refresh();
}
Program: 148871
Project: 148871
Buggy source:
public void doubleClick(DoubleClickEvent event){
  ISelection selection=ServerView.this.getViewer().getSelection();
  TreeObject xo=(TreeObject)((IStructuredSelection)selection).getFirstElement();
  if (xo.getType() == TreeObject._ACTION_) {
    Class<?> actionClass=(Class<?>)xo.getWsKey();
    try {
      AServerViewAction action=(AServerViewAction)actionClass.newInstance();
      action.setServerView(ServerView.this);
      action.run();
    }
 catch (    Exception ex) {
      MessageDialog.openError(viewer.getControl().getShell(),"String_Node_Str","String_Node_Str");
    }
    return;
  }
  if (xo.getType() == TreeObject.WORKFLOW)   return;
  if (xo.getType() == TreeObject.SUBSCRIPTION_ENGINE || (xo.getType() == TreeObject.DATA_CLUSTER && xo.isXObject()) || xo.getType() == TreeObject.WORKFLOW_PROCESS)   browseViewAction.run();
 else   editXObjectAction.run();
}

Fixed version (ground truth):
public void doubleClick(DoubleClickEvent event){
  ISelection selection=ServerView.this.getViewer().getSelection();
  TreeObject xo=(TreeObject)((IStructuredSelection)selection).getFirstElement();
  if (xo.getType() == TreeObject._ACTION_) {
    Class<?> actionClass=(Class<?>)xo.getWsKey();
    try {
      AServerViewAction action=(AServerViewAction)actionClass.newInstance();
      action.setServerView(ServerView.this);
      action.run();
    }
 catch (    Exception ex) {
      MessageDialog.openError(viewer.getControl().getShell(),"String_Node_Str","String_Node_Str");
    }
    return;
  }
  if (xo.getType() == TreeObject._SERVER_) {
    if (xo.getServerRoot().getChildren().length == 0) {
      String universe="String_Node_Str";
      String username="String_Node_Str";
      String password="String_Node_Str";
      if (xo.getWsObject().toString().contains("String_Node_Str")) {
        universe=xo.getWsObject().toString().split("String_Node_Str")[0];
        username=xo.getWsObject().toString().split("String_Node_Str")[1].split("String_Node_Str")[0];
        password=xo.getWsObject().toString().split("String_Node_Str")[1].split("String_Node_Str")[1];
      }
 else {
        username=xo.getWsObject().toString().split("String_Node_Str")[0];
        password=xo.getWsObject().toString().split("String_Node_Str")[1];
      }
      initServerTree(xo.getWsKey().toString(),username,password,universe);
      xo.getServerRoot().getParent().removeChild(xo.getServerRoot());
    }
  }
  if (xo.getType() == TreeObject.WORKFLOW)   return;
  if (xo.getType() == TreeObject.SUBSCRIPTION_ENGINE || (xo.getType() == TreeObject.DATA_CLUSTER && xo.isXObject()) || xo.getType() == TreeObject.WORKFLOW_PROCESS)   browseViewAction.run();
 else   editXObjectAction.run();
}
Program: 148872
Project: 148872
Buggy source:
private void hookDoubleClickAction(){
  viewer.addDoubleClickListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      ISelection selection=ServerView.this.getViewer().getSelection();
      TreeObject xo=(TreeObject)((IStructuredSelection)selection).getFirstElement();
      if (xo.getType() == TreeObject._ACTION_) {
        Class<?> actionClass=(Class<?>)xo.getWsKey();
        try {
          AServerViewAction action=(AServerViewAction)actionClass.newInstance();
          action.setServerView(ServerView.this);
          action.run();
        }
 catch (        Exception ex) {
          MessageDialog.openError(viewer.getControl().getShell(),"String_Node_Str","String_Node_Str");
        }
        return;
      }
      if (xo.getType() == TreeObject.WORKFLOW)       return;
      if (xo.getType() == TreeObject.SUBSCRIPTION_ENGINE || (xo.getType() == TreeObject.DATA_CLUSTER && xo.isXObject()) || xo.getType() == TreeObject.WORKFLOW_PROCESS)       browseViewAction.run();
 else       editXObjectAction.run();
    }
  }
);
}

Fixed version (ground truth):
private void hookDoubleClickAction(){
  viewer.addDoubleClickListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      ISelection selection=ServerView.this.getViewer().getSelection();
      TreeObject xo=(TreeObject)((IStructuredSelection)selection).getFirstElement();
      if (xo.getType() == TreeObject._ACTION_) {
        Class<?> actionClass=(Class<?>)xo.getWsKey();
        try {
          AServerViewAction action=(AServerViewAction)actionClass.newInstance();
          action.setServerView(ServerView.this);
          action.run();
        }
 catch (        Exception ex) {
          MessageDialog.openError(viewer.getControl().getShell(),"String_Node_Str","String_Node_Str");
        }
        return;
      }
      if (xo.getType() == TreeObject._SERVER_) {
        if (xo.getServerRoot().getChildren().length == 0) {
          String universe="String_Node_Str";
          String username="String_Node_Str";
          String password="String_Node_Str";
          if (xo.getWsObject().toString().contains("String_Node_Str")) {
            universe=xo.getWsObject().toString().split("String_Node_Str")[0];
            username=xo.getWsObject().toString().split("String_Node_Str")[1].split("String_Node_Str")[0];
            password=xo.getWsObject().toString().split("String_Node_Str")[1].split("String_Node_Str")[1];
          }
 else {
            username=xo.getWsObject().toString().split("String_Node_Str")[0];
            password=xo.getWsObject().toString().split("String_Node_Str")[1];
          }
          initServerTree(xo.getWsKey().toString(),username,password,universe);
          xo.getServerRoot().getParent().removeChild(xo.getServerRoot());
        }
      }
      if (xo.getType() == TreeObject.WORKFLOW)       return;
      if (xo.getType() == TreeObject.SUBSCRIPTION_ENGINE || (xo.getType() == TreeObject.DATA_CLUSTER && xo.isXObject()) || xo.getType() == TreeObject.WORKFLOW_PROCESS)       browseViewAction.run();
 else       editXObjectAction.run();
    }
  }
);
}
Program: 148874
Project: 148874
Buggy source:
public void keyReleased(KeyEvent event){
  int start=serviceParametersText.getSelection().x;
  int end=serviceParametersText.getSelection().y;
  if (event.stateMask == SWT.CTRL && event.keyCode == 17) {
    ResourceSelectDialog dialog=new ResourceSelectDialog(getSite().getShell(),treeParent.getParent(),"String_Node_Str",ServerView.show().getSite());
    dialog.setBlockOnOpen(true);
    dialog.open();
    String xpath=dialog.getXpath();
    String textHead=serviceParametersText.getText(0,start - 1);
    String textEnd=serviceParametersText.getText(end,serviceParametersText.getText().length());
    serviceParametersText.setText(textHead + xpath + textEnd);
    serviceParametersText.setSelection(start,start + xpath.length());
    markDirtyWithoutCommit();
  }
}

Fixed version (ground truth):
public void keyReleased(KeyEvent event){
  int start=serviceParametersText.getSelection().x;
  int end=serviceParametersText.getSelection().y;
  if (event.stateMask == SWT.CTRL && event.keyCode == 17) {
    ResourceSelectDialog dialog=new ResourceSelectDialog(getSite().getShell(),treeParent.getParent(),"String_Node_Str",ServerView.show().getSite());
    dialog.setBlockOnOpen(true);
    dialog.open();
    if (dialog.getReturnCode() == Window.OK) {
      String xpath=dialog.getXpath();
      String textHead=serviceParametersText.getText(0,start - 1);
      String textEnd=serviceParametersText.getText(end,serviceParametersText.getText().length());
      serviceParametersText.setText(textHead + xpath + textEnd);
      serviceParametersText.setSelection(start,start + xpath.length());
      markDirtyWithoutCommit();
    }
  }
}
Program: 148878
Project: 148878
Buggy source:
private int isOveride(String name){
  final MessageDialog dialog=new MessageDialog(view.getSite().getShell(),"String_Node_Str",null,"String_Node_Str" + name + "String_Node_Str",MessageDialog.QUESTION,new String[]{IDialogConstants.YES_LABEL,IDialogConstants.YES_TO_ALL_LABEL,IDialogConstants.NO_LABEL,IDialogConstants.CANCEL_LABEL},0);
  dialog.open();
  int result=dialog.getReturnCode();
  if (result == 0) {
    return IDialogConstants.YES_ID;
  }
  if (result == 1) {
    return IDialogConstants.YES_TO_ALL_ID;
  }
  if (result == 2) {
    return IDialogConstants.NO_ID;
  }
  return IDialogConstants.CANCEL_ID;
}

Fixed version (ground truth):
private int isOveride(String name,String obTypeName){
  final MessageDialog dialog=new MessageDialog(view.getSite().getShell(),"String_Node_Str",null,"String_Node_Str" + obTypeName + "String_Node_Str"+ name+ "String_Node_Str",MessageDialog.QUESTION,new String[]{IDialogConstants.YES_LABEL,IDialogConstants.YES_TO_ALL_LABEL,IDialogConstants.NO_LABEL,IDialogConstants.CANCEL_LABEL},0);
  dialog.open();
  int result=dialog.getReturnCode();
  if (result == 0) {
    return IDialogConstants.YES_ID;
  }
  if (result == 1) {
    return IDialogConstants.YES_TO_ALL_ID;
  }
  if (result == 2) {
    return IDialogConstants.NO_ID;
  }
  return IDialogConstants.CANCEL_ID;
}
Program: 148885
Project: 148885
Buggy source:
public MenuEntryDialog(WSMenuEntry wsMenuEntry,SelectionListener caller,Shell parentShell,String title,boolean isChanged){
  super(parentShell);
  this.wsMenuEntry=wsMenuEntry;
  this.caller=caller;
  this.title=title;
  this.isChanged=isChanged;
  WSMenuMenuEntriesDescriptions[] descriptions=wsMenuEntry.getDescriptions();
  if (descriptions != null) {
    for (int i=0; i < descriptions.length; i++) {
      descriptionsMap.put(descriptions[i].getLanguage(),descriptions[i].getLabel());
    }
  }
}

Fixed version (ground truth):
public MenuEntryDialog(WSMenuEntry wsMenuEntry,SelectionListener caller,Shell parentShell,String title,boolean isChanged,String uripre){
  super(parentShell);
  this.wsMenuEntry=wsMenuEntry;
  this.caller=caller;
  this.title=title;
  this.isChanged=isChanged;
  this.uripre=uripre;
  WSMenuMenuEntriesDescriptions[] descriptions=wsMenuEntry.getDescriptions();
  if (descriptions != null) {
    for (int i=0; i < descriptions.length; i++) {
      descriptionsMap.put(descriptions[i].getLanguage(),descriptions[i].getLabel());
    }
  }
}
Program: 148887
Project: 148887
Buggy source:
@Override protected void okPressed(){
  setReturnCode(OK);
  getButton(IDialogConstants.OK_ID).setData("String_Node_Str",MenuEntryDialog.this);
}

Fixed version (ground truth):
@Override protected void okPressed(){
  setReturnCode(OK);
  getButton(IDialogConstants.OK_ID).setData("String_Node_Str",MenuEntryDialog.this);
  try {
    String icon="String_Node_Str";
    if (wsMenuEntry.getIcon() != null) {
      if (!wsMenuEntry.getIcon().equalsIgnoreCase(getIconPathText().getText())) {
        Util.uploadImageFile(uripre + "String_Node_Str" + wsMenuEntry.getIcon(),"String_Node_Str","String_Node_Str","String_Node_Str");
        if (!"String_Node_Str".equalsIgnoreCase(getIconPathText().getText()))         icon=Util.uploadImageFile(uripre + "String_Node_Str",getIconPathText().getText(),"String_Node_Str","String_Node_Str");
        getIconPathText().setText(icon);
      }
    }
 else     if (!"String_Node_Str".equalsIgnoreCase(getIconPathText().getText()))     icon=Util.uploadImageFile(uripre + "String_Node_Str",getIconPathText().getText(),"String_Node_Str","String_Node_Str");
    getIconPathText().setText(icon);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 148888
Project: 148888
Buggy source:
public MenuMainPage(FormEditor editor){
  super(editor,MenuMainPage.class.getName(),"String_Node_Str" + ((XObjectEditorInput)editor.getEditorInput()).getName() + Util.getRevision((TreeObject)((XObjectEditorInput)editor.getEditorInput()).getModel()));
}

Fixed version (ground truth):
public MenuMainPage(FormEditor editor){
  super(editor,MenuMainPage.class.getName(),"String_Node_Str" + ((XObjectEditorInput)editor.getEditorInput()).getName() + Util.getRevision((TreeObject)((XObjectEditorInput)editor.getEditorInput()).getModel()));
  uripre=((TreeObject)((XObjectEditorInput)editor.getEditorInput()).getModel()).getEndpointIpAddress();
}
Program: 148889
Project: 148889
Buggy source:
public TreeEntryAddAction(TreeViewer view,int location){
  super();
  this.viewer=view;
  this.location=location;
  String label="String_Node_Str";
  TreeEntry currentEntry=(TreeEntry)((IStructuredSelection)viewer.getSelection()).getFirstElement();
switch (location) {
case LOCATION_UNDER:
    position=0;
  treeEntry=new TreeEntry(currentEntry,new WSMenuEntry("String_Node_Str",null,"String_Node_Str","String_Node_Str",null));
label="String_Node_Str" + currentEntry.getWsMenuEntry().getId();
break;
case LOCATION_BEFORE:
position=findSubMenuPosition(currentEntry);
treeEntry=new TreeEntry(currentEntry.getParentTreeEntry(),new WSMenuEntry("String_Node_Str",null,"String_Node_Str","String_Node_Str",null));
label="String_Node_Str";
break;
case LOCATION_AFTER:
position=findSubMenuPosition(currentEntry);
treeEntry=new TreeEntry(currentEntry.getParentTreeEntry(),new WSMenuEntry("String_Node_Str",null,"String_Node_Str","String_Node_Str",null));
label="String_Node_Str";
break;
}
setImageDescriptor(ImageCache.getImage("String_Node_Str"));
setText(label);
setToolTipText("String_Node_Str");
}

Fixed version (ground truth):
public TreeEntryAddAction(TreeViewer view,int location){
  super();
  this.viewer=view;
  this.location=location;
  String label="String_Node_Str";
  TreeEntry currentEntry=(TreeEntry)((IStructuredSelection)viewer.getSelection()).getFirstElement();
switch (location) {
case LOCATION_UNDER:
    position=0;
  treeEntry=new TreeEntry(currentEntry,new WSMenuEntry("String_Node_Str",null,"String_Node_Str","String_Node_Str","String_Node_Str",null));
label="String_Node_Str" + currentEntry.getWsMenuEntry().getId();
break;
case LOCATION_BEFORE:
position=findSubMenuPosition(currentEntry);
treeEntry=new TreeEntry(currentEntry.getParentTreeEntry(),new WSMenuEntry("String_Node_Str",null,"String_Node_Str","String_Node_Str","String_Node_Str",null));
label="String_Node_Str";
break;
case LOCATION_AFTER:
position=findSubMenuPosition(currentEntry);
treeEntry=new TreeEntry(currentEntry.getParentTreeEntry(),new WSMenuEntry("String_Node_Str",null,"String_Node_Str","String_Node_Str","String_Node_Str",null));
label="String_Node_Str";
break;
}
setImageDescriptor(ImageCache.getImage("String_Node_Str"));
setText(label);
setToolTipText("String_Node_Str");
}
Program: 148891
Project: 148891
Buggy source:
private static void postContent(String uri,HttpPost httppost) throws Exception, IOException {
  DefaultHttpClient httpclient=new DefaultHttpClient();
  httpclient.getCredentialsProvider().setCredentials(new AuthScope(getEndpointHost(uri),Integer.valueOf(getEndpointPort(uri))),new UsernamePasswordCredentials("String_Node_Str","String_Node_Str"));
  System.out.println("String_Node_Str" + httppost.getRequestLine());
  HttpResponse response=httpclient.execute(httppost);
  HttpEntity entity=response.getEntity();
  entity=response.getEntity();
  try {
    Header[] headers=response.getAllHeaders();
    String responseString=null;
    if (response.getEntity() != null) {
      responseString=EntityUtils.toString(response.getEntity());
    }
  }
  finally {
    if (entity != null)     entity.consumeContent();
  }
  if (entity != null) {
    entity.consumeContent();
  }
  httpclient.getConnectionManager().shutdown();
}

Fixed version (ground truth):
private static void postContent(String uri,HttpPost httppost) throws Exception, IOException {
  DefaultHttpClient httpclient=new DefaultHttpClient();
  httpclient.getCredentialsProvider().setCredentials(new AuthScope(getEndpointHost(uri),Integer.valueOf(getEndpointPort(uri))),new UsernamePasswordCredentials("String_Node_Str","String_Node_Str"));
  System.out.println("String_Node_Str" + httppost.getRequestLine());
  HttpResponse response=httpclient.execute(httppost);
  HttpEntity entity=response.getEntity();
  try {
    Header[] headers=response.getAllHeaders();
    String responseString=null;
    if (response.getEntity() != null) {
      responseString=EntityUtils.toString(response.getEntity());
    }
  }
  finally {
    if (entity != null)     entity.consumeContent();
  }
  if (entity != null) {
    entity.consumeContent();
  }
  httpclient.getConnectionManager().shutdown();
}
Program: 148893
Project: 148893
Buggy source:
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;
}

Fixed version (ground truth):
public boolean checkInPasteType(){
  if (WorkbenchClipboard.getWorkbenchClipboard().getConcepts().size() <= 0)   return false;
 else   return true;
}