nus-yam/ex-repair huggingface dataset:
Program: 122488
Project: 122488
Buggy source:
public Map<String,File> getComponentsProvidersFolder(){
  Map<String,File> list=new HashMap<String,File>();
  ComponentsProviderManager componentsProviderManager=ComponentsProviderManager.getInstance();
  for (  AbstractComponentsProvider componentsProvider : componentsProviderManager.getProviders()) {
    try {
      list.put(componentsProvider.getContributer(),componentsProvider.getInstallationFolder());
    }
 catch (    IOException e) {
      ExceptionHandler.process(e);
      continue;
    }
  }
  return list;
}

Fixed version (ground truth):
@Override public Map<String,File> getComponentsProvidersFolder(){
  Map<String,File> list=new HashMap<String,File>();
  ComponentsProviderManager componentsProviderManager=ComponentsProviderManager.getInstance();
  for (  AbstractComponentsProvider componentsProvider : componentsProviderManager.getProviders()) {
    try {
      list.put(componentsProvider.getContributer(),componentsProvider.getInstallationFolder());
    }
 catch (    IOException e) {
      ExceptionHandler.process(e);
      continue;
    }
  }
  return list;
}
Program: 122489
Project: 122489
Buggy source:
public void reset(){
  componentsImageRegistry.clear();
  componentList=null;
  skeletonList=null;
  customComponentList=null;
  allComponents=null;
}

Fixed version (ground truth):
@Override public void reset(){
  componentsImageRegistry.clear();
  componentList=null;
  skeletonList=null;
  customComponentList=null;
  allComponents=null;
}
Program: 122492
Project: 122492
Buggy source:
public List<String> getSkeletons(){
  if (skeletonList == null) {
    init(false);
  }
  return skeletonList;
}

Fixed version (ground truth):
@Override public List<String> getSkeletons(){
  if (skeletonList == null) {
    init(false);
  }
  return skeletonList;
}
Program: 122494
Project: 122494
Buggy source:
/** 
 * Parse the XML file. Buffer the result in LoopEntry.
 * @param is InputStream
 */
public void parse(java.io.InputStream is,String charset){
  this.charset=charset;
  try {
    DefaultHandler hd=null;
    SAXParser saxParser=SAXParserFactory.newInstance().newSAXParser();
    if (rootPath == null || rootPath.equals("String_Node_Str")) {
      hd=newHandler();
    }
 else {
      hd=newHandler2();
    }
    saxParser.setProperty("String_Node_Str",hd);
    org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(new UnicodeReader(is,this.charset));
    saxParser.parse(is,hd);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Parse the XML file. Buffer the result in LoopEntry.
 * @param is InputStream
 */
public void parse(java.io.InputStream is,String charset){
  this.charset=charset;
  Reader reader=null;
  try {
    DefaultHandler hd=null;
    SAXParser saxParser=SAXParserFactory.newInstance().newSAXParser();
    if (rootPath == null || rootPath.equals("String_Node_Str")) {
      hd=newHandler();
    }
 else {
      hd=newHandler2();
    }
    saxParser.setProperty("String_Node_Str",hd);
    reader=new UnicodeReader(is,this.charset);
    org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(reader);
    saxParser.parse(inSource,hd);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    if (reader != null) {
      try {
        reader.close();
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 122495
Project: 122495
Buggy source:
public Object call() throws Exception {
  try {
    DefaultHandler hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    saxParser.setProperty("String_Node_Str",hd);
    if (fileURL != null) {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset));
      saxParser.parse(inSource,hd);
    }
 else {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(new UnicodeReader(is,this.charset));
      saxParser.parse(is,hd);
    }
  }
  finally {
    bcache.notifyErrorOccurred();
  }
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  Reader reader=null;
  try {
    DefaultHandler hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    saxParser.setProperty("String_Node_Str",hd);
    if (fileURL != null) {
      reader=new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset);
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(reader);
      saxParser.parse(inSource,hd);
    }
 else {
      reader=new UnicodeReader(is,this.charset);
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(reader);
      saxParser.parse(inSource,hd);
    }
  }
  finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
  finally {
      bcache.notifyErrorOccurred();
    }
  }
  return null;
}
Program: 122498
Project: 122498
Buggy source:
private void syncOutputNodeColumnsList(List<ColumnNameChanged> columnNameChanged){
  if (outputdataContainer == null) {
    return;
  }
  for (  IConnection conn : node.getOutgoingConnections()) {
    INode targetNode=conn.getTarget();
    EConnectionType connStyle=conn.getLineStyle();
    if (EConnectionType.FLOW_MAIN.equals(connStyle) || EConnectionType.FLOW_MERGE.equals(connStyle) || EConnectionType.FLOW_REF.equals(connStyle)) {
      ColumnListController.updateColumnList(targetNode,columnNameChanged);
    }
  }
}

Fixed version (ground truth):
private void syncOutputNodeColumnsList(List<ColumnNameChanged> columnNameChanged){
  if (outputdataContainer == null) {
    return;
  }
  for (  IConnection conn : node.getOutgoingConnections()) {
    INode targetNode=conn.getTarget();
    EConnectionType connStyle=conn.getLineStyle();
    if (EConnectionType.FLOW_MAIN.equals(connStyle) || EConnectionType.FLOW_MERGE.equals(connStyle) || EConnectionType.FLOW_REF.equals(connStyle)) {
      ColumnListController.updateColumnList(targetNode,columnNameChanged);
      IElementParameter defaultMap=targetNode.getElementParameter(EParameterName.DEFAULT_MAP.getName());
      if (defaultMap != null) {
        if ("String_Node_Str".equals(targetNode.getComponent().getName())) {
          IElementParameter elementParameter=targetNode.getElementParameter("String_Node_Str");
          if (elementParameter != null) {
            Object value=elementParameter.getValue();
            if (value instanceof List) {
              for (              Object obj : (List)value) {
                if (obj instanceof Map) {
                  Object object=((Map)obj).get("String_Node_Str");
                  if (newOutputMetadata != null && !newOutputMetadata.getListColumns().isEmpty()) {
                    boolean found=false;
                    for (                    IMetadataColumn column : newOutputMetadata.getListColumns()) {
                      if (column.getLabel().equals(object)) {
                        found=true;
                      }
                    }
                    if (!found) {
                      ((Map)obj).put("String_Node_Str",newOutputMetadata.getListColumns().get(0).getLabel());
                    }
                  }
 else {
                    ((Map)obj).put("String_Node_Str","String_Node_Str");
                  }
                }
              }
            }
          }
        }
        targetNode.setPropertyValue(EParameterName.DEFAULT_MAP.getName(),defaultMap.getValue());
      }
    }
  }
}
Program: 122500
Project: 122500
Buggy source:
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  List obj=getSelectedObjects();
  if (o == null && systemObject != null && systemObject instanceof String && (obj.get(0) instanceof NodeLabelEditPart || obj.get(0) instanceof ConnLabelEditPart || obj.get(0) instanceof NoteEditPart)) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  List obj=getSelectedObjects();
  if (o == null && systemObject != null && systemObject instanceof String && obj != null && obj.size() == 1 && (obj.get(0) instanceof NodeLabelEditPart || obj.get(0) instanceof ConnLabelEditPart || obj.get(0) instanceof NoteEditPart)) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}
Program: 122504
Project: 122504
Buggy source:
/** 
 * DOC mhirt Comment method "loadMethod".
 * @param methodName
 * @return
 * @throws MalformedURLException
 * @throws ClassNotFoundException
 */
private static Method loadMethod(URL url,String methodName,JetBean unit) throws ClassNotFoundException {
  if (currentClassLoader != unit.getClassLoader()) {
    currentClassLoader=unit.getClassLoader();
    theClassLoader=new URLClassLoader(new URL[]{url},unit.getClassLoader());
  }
  Class theClass;
  try {
    theClass=theClassLoader.loadClass(unit.getClassName());
  }
 catch (  Error e) {
    throw new ClassNotFoundException(e.getMessage(),e);
  }
  Method[] methods=theClass.getDeclaredMethods();
  for (int i=0; i < methods.length; ++i) {
    if (methods[i].getName().equals(methodName)) {
      return methods[i];
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC mhirt Comment method "loadMethod".
 * @param methodName
 * @return
 * @throws MalformedURLException
 * @throws ClassNotFoundException
 */
private static Method loadMethod(URL url,String methodName,JetBean unit) throws ClassNotFoundException {
  if (currentClassLoader != unit.getClassLoader()) {
    currentClassLoader=unit.getClassLoader();
    theClassLoader=new URLClassLoader(new URL[]{url},unit.getClassLoader());
  }
  Class theClass;
  try {
    theClass=theClassLoader.loadClass(unit.getClassName());
  }
 catch (  Error e) {
    throw new ClassNotFoundException(e.getMessage(),e);
  }
  try {
    Method[] methods=theClass.getDeclaredMethods();
    for (int i=0; i < methods.length; ++i) {
      if (methods[i].getName().equals(methodName)) {
        return methods[i];
      }
    }
  }
 catch (  Exception e) {
    return null;
  }
  return null;
}
Program: 122505
Project: 122505
Buggy source:
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  List obj=getSelectedObjects();
  if (o == null && systemObject != null && systemObject instanceof String && (obj.get(0) instanceof NodeLabelEditPart || obj.get(0) instanceof ConnLabelEditPart || obj.get(0) instanceof NoteEditPart)) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  List obj=getSelectedObjects();
  if (o == null && systemObject != null && systemObject instanceof String && obj != null && obj.size() == 1 && (obj.get(0) instanceof NodeLabelEditPart || obj.get(0) instanceof ConnLabelEditPart || obj.get(0) instanceof NoteEditPart)) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}
Program: 122507
Project: 122507
Buggy source:
@Override protected Control createContents(Composite p){
  Composite parent=(Composite)super.createContents(p);
  Label scriptLabel=new Label(parent,SWT.NONE);
  scriptLabel.setText(getHeadTitle());
  final StyledText scriptTxt=new StyledText(parent,SWT.MULTI | SWT.BORDER | SWT.H_SCROLL| SWT.V_SCROLL);
  GridData layoutData=new GridData(GridData.FILL_BOTH);
  layoutData.heightHint=450;
  layoutData.minimumHeight=450;
  layoutData.widthHint=550;
  layoutData.minimumWidth=550;
  scriptTxt.setLayoutData(layoutData);
  scriptTxt.setText(getPreferenceStore().getString(getPreferenceKey()));
  scriptTxt.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      getPreferenceStore().setValue(getPreferenceKey(),((StyledText)e.getSource()).getText().trim());
    }
  }
);
  return parent;
}

Fixed version (ground truth):
@Override protected Control createContents(Composite p){
  Composite parent=(Composite)super.createContents(p);
  Label scriptLabel=new Label(parent,SWT.NONE);
  scriptLabel.setText(getHeadTitle());
  scriptTxt=new StyledText(parent,SWT.MULTI | SWT.BORDER | SWT.H_SCROLL| SWT.V_SCROLL);
  GridData layoutData=new GridData(GridData.FILL_BOTH);
  layoutData.heightHint=450;
  layoutData.minimumHeight=450;
  layoutData.widthHint=550;
  layoutData.minimumWidth=550;
  scriptTxt.setLayoutData(layoutData);
  scriptTxt.setText(getPreferenceStore().getString(getPreferenceKey()));
  return parent;
}
Program: 122508
Project: 122508
Buggy source:
public static JobScriptsManager createManagerInstance(Map<ExportChoice,Object> exportChoiceMap,String contextName,String launcher,int statisticPort,int tracePort,JobExportType jobExportType){
  ECodeLanguage language=LanguageManager.getCurrentLanguage();
  if (language == ECodeLanguage.JAVA) {
switch (jobExportType) {
case POJO:
      return new JobJavaScriptsManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
case WSWAR:
    return new JobJavaScriptsWSManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort,"String_Node_Str");
case WSZIP:
  return new JobJavaScriptsWSManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort,"String_Node_Str");
case JBOSSESB:
return new JobJavaScriptESBManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
case PETALSESB:
return new PetalsJobJavaScriptsManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
case OSGI:
if (exportChoiceMap.containsKey(ExportChoice.needMavenScript) && exportChoiceMap.get(ExportChoice.needMavenScript) == Boolean.TRUE) {
return new JobJavaScriptOSGIForESBWithMavenManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
}
 else {
return new JobJavaScriptOSGIForESBManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
}
}
}
return new JobJavaScriptsManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
}

Fixed version (ground truth):
public static JobScriptsManager createManagerInstance(Map<ExportChoice,Object> exportChoiceMap,String contextName,String launcher,int statisticPort,int tracePort,JobExportType jobExportType){
  ECodeLanguage language=LanguageManager.getCurrentLanguage();
  if (language == ECodeLanguage.JAVA) {
switch (jobExportType) {
case POJO:
      return new JobJavaScriptsManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
case WSWAR:
    return new JobJavaScriptsWSManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort,"String_Node_Str");
case WSZIP:
  return new JobJavaScriptsWSManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort,"String_Node_Str");
case JBOSSESB:
return new JobJavaScriptESBManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
case PETALSESB:
return new PetalsJobJavaScriptsManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
case OSGI:
if (exportChoiceMap.containsKey(ExportChoice.needMavenScript) && exportChoiceMap.get(ExportChoice.needMavenScript) == Boolean.TRUE) {
return new OSGIJavaScriptForESBWithMavenManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
}
 else {
return new JobJavaScriptOSGIForESBManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
}
}
}
return new JobJavaScriptsManager(exportChoiceMap,contextName,launcher,statisticPort,tracePort);
}
Program: 122510
Project: 122510
Buggy source:
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  if (o == null && systemObject != null && systemObject instanceof String) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  List obj=getSelectedObjects();
  if (o == null && systemObject != null && systemObject instanceof String && (obj.get(0) instanceof NodeLabelEditPart || obj.get(0) instanceof ConnLabelEditPart)) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}
Program: 122512
Project: 122512
Buggy source:
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  if (o == null && systemObject != null && systemObject instanceof String) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  List obj=getSelectedObjects();
  if (o == null && systemObject != null && systemObject instanceof String && (obj.get(0) instanceof NodeLabelEditPart || obj.get(0) instanceof ConnLabelEditPart)) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}
Program: 122515
Project: 122515
Buggy source:
public void addSheetsParameters(){
  TextElementParameter param=new TextElementParameter("String_Node_Str",Boolean.toString(excelBean.isSelectAllSheets()));
  addParameter(param);
  ArrayList x=excelBean.getSheetsList();
  if (x == null) {
    x=new ArrayList();
    x.add("String_Node_Str");
  }
  List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
  for (  Object string : x) {
    Map<String,Object> map=new HashMap<String,Object>();
    map.put("String_Node_Str",TalendTextUtils.addQuotes(string.toString()));
    list.add(map);
  }
  ObjectElementParameter sheetsListParam=new ObjectElementParameter("String_Node_Str",list);
  sheetsListParam.setListItemsDisplayCodeName(new String[]{"String_Node_Str"});
  addParameter(sheetsListParam);
}

Fixed version (ground truth):
public void addSheetsParameters(){
  if (Boolean.toString(excelBean.isSelectAllSheets()) != null) {
    IElementParameter param=this.getElementParameter("String_Node_Str");
    if (param != null) {
      param.setValue(Boolean.toString(excelBean.isSelectAllSheets()));
    }
  }
  ArrayList x=excelBean.getSheetsList();
  if (x == null) {
    x=new ArrayList();
    x.add("String_Node_Str");
  }
  List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
  for (  Object string : x) {
    Map<String,Object> map=new HashMap<String,Object>();
    map.put("String_Node_Str",TalendTextUtils.addQuotes(string.toString()));
    list.add(map);
  }
  IElementParameter param=this.getElementParameter("String_Node_Str");
  if (param != null) {
    param.setValue(list);
  }
}
Program: 122517
Project: 122517
Buggy source:
public void addJavaSpecificParameters(){
  String[] paramNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  String[] paramValues=new String[]{Boolean.toString(excelBean.isAdvancedSeparator()),TalendTextUtils.addQuotes(excelBean.getThousandSeparator()),TalendTextUtils.addQuotes(excelBean.getDecimalSeparator())};
  for (int i=0; i < paramNames.length; i++) {
    if (paramValues[i] != null && !paramValues[i].equals("String_Node_Str")) {
      TextElementParameter param=new TextElementParameter(paramNames[i],paramValues[i]);
      addParameter(param);
    }
  }
}

Fixed version (ground truth):
public void addJavaSpecificParameters(){
  String[] paramNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  String[] paramValues=new String[]{Boolean.toString(excelBean.isAdvancedSeparator()),TalendTextUtils.addQuotes(excelBean.getThousandSeparator()),TalendTextUtils.addQuotes(excelBean.getDecimalSeparator())};
  for (int i=0; i < paramNames.length; i++) {
    if (paramValues[i] != null && !paramValues[i].equals("String_Node_Str")) {
      IElementParameter param=this.getElementParameter(paramNames[i]);
      if (param != null) {
        param.setValue(paramValues[i]);
      }
    }
  }
}
Program: 122518
Project: 122518
Buggy source:
public static String getTmpFolder(){
  String tmp=System.getProperty("String_Node_Str") + "String_Node_Str";
  tmp=tmp.replace('\\','/');
  File f=new File(tmp);
  if (!f.exists()) {
    f.mkdir();
  }
  return tmp;
}

Fixed version (ground truth):
public static String getTmpFolder(){
  String tmp=getTmpFolderPath() + "String_Node_Str";
  tmp=tmp.replace('\\','/');
  File f=new File(tmp);
  if (!f.exists()) {
    f.mkdir();
  }
  return tmp;
}
Program: 122519
Project: 122519
Buggy source:
/** 
 * DOC zli Comment method "getTmpDestinationFolder".
 * @return
 */
public static String getTmpDestinationFolder(){
  String tmp=System.getProperty("String_Node_Str") + "String_Node_Str";
  tmp=tmp.replace('\\','/');
  File f=new File(tmp);
  if (!f.exists()) {
    f.mkdir();
  }
  return tmp;
}

Fixed version (ground truth):
/** 
 * DOC zli Comment method "getTmpDestinationFolder".
 * @return
 */
public static String getTmpDestinationFolder(){
  String tmp=getTmpFolderPath() + "String_Node_Str";
  tmp=tmp.replace('\\','/');
  File f=new File(tmp);
  if (!f.exists()) {
    f.mkdir();
  }
  return tmp;
}
Program: 122520
Project: 122520
Buggy source:
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  List obj=getSelectedObjects();
  if (o == null && systemObject != null && systemObject instanceof String && (obj.get(0) instanceof NodeLabelEditPart || obj.get(0) instanceof ConnLabelEditPart)) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  List obj=getSelectedObjects();
  if (o == null && systemObject != null && systemObject instanceof String && (obj.get(0) instanceof NodeLabelEditPart || obj.get(0) instanceof ConnLabelEditPart || obj.get(0) instanceof NoteEditPart)) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}
Program: 122521
Project: 122521
Buggy source:
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  List obj=getSelectedObjects();
  if (o == null && systemObject != null && systemObject instanceof String && (obj.get(0) instanceof NodeLabelEditPart || obj.get(0) instanceof ConnLabelEditPart)) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  Object o;
  try {
    o=Clipboard.getDefault().getContents();
  }
 catch (  RuntimeException e) {
    return false;
  }
  org.eclipse.swt.dnd.Clipboard systemClipboard=new org.eclipse.swt.dnd.Clipboard(Display.getCurrent());
  Object systemObject=null;
  if (systemClipboard != null) {
    systemObject=systemClipboard.getContents(TextTransfer.getInstance());
  }
  List obj=getSelectedObjects();
  if (o == null && systemObject != null && systemObject instanceof String && (obj.get(0) instanceof NodeLabelEditPart || obj.get(0) instanceof ConnLabelEditPart || obj.get(0) instanceof NoteEditPart)) {
    return true;
  }
  if (o instanceof String) {
    return true;
  }
  if (!(o instanceof List)) {
    return false;
  }
  List objects=(List)o;
  if (objects.isEmpty()) {
    return false;
  }
  for (  Object currentObject : objects) {
    if (!(currentObject instanceof NodePart) && !(currentObject instanceof NoteEditPart) && !(currentObject instanceof SubjobContainerPart)) {
      return false;
    }
  }
  return true;
}
Program: 122522
Project: 122522
Buggy source:
@Override protected boolean calculateEnabled(){
  List objects=getSelectedObjects();
  if (!objects.isEmpty()) {
    for (    Object o : objects) {
      if (o instanceof NoteEditPart) {
        return true;
      }
      if (o instanceof NodeLabelEditPart) {
        return true;
      }
      if (o instanceof SubjobContainerPart) {
        return true;
      }
      if (!(o instanceof NodePart) && !(o instanceof NoteEditPart)) {
        return false;
      }
      AbstractProcessProvider pProvider=AbstractProcessProvider.findProcessProviderFromPID(IComponent.JOBLET_PID);
      if (pProvider != null && !pProvider.canCopyNode((Node)((NodePart)o).getModel())) {
        return false;
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  List objects=getSelectedObjects();
  if (!objects.isEmpty()) {
    for (    Object o : objects) {
      if (o instanceof NoteEditPart) {
        return true;
      }
      if (o instanceof NodeLabelEditPart) {
        return true;
      }
      if (o instanceof ConnLabelEditPart) {
        return true;
      }
      if (o instanceof SubjobContainerPart) {
        return true;
      }
      if (!(o instanceof NodePart) && !(o instanceof NoteEditPart)) {
        return false;
      }
      AbstractProcessProvider pProvider=AbstractProcessProvider.findProcessProviderFromPID(IComponent.JOBLET_PID);
      if (pProvider != null && !pProvider.canCopyNode((Node)((NodePart)o).getModel())) {
        return false;
      }
    }
    return true;
  }
  return false;
}
Program: 122523
Project: 122523
Buggy source:
@Override protected boolean calculateEnabled(){
  List objects=getSelectedObjects();
  if (!objects.isEmpty()) {
    for (    Object o : objects) {
      if (o instanceof NoteEditPart) {
        return true;
      }
      if (o instanceof NodeLabelEditPart) {
        return true;
      }
      if (o instanceof SubjobContainerPart) {
        return true;
      }
      if (!(o instanceof NodePart) && !(o instanceof NoteEditPart)) {
        return false;
      }
      AbstractProcessProvider pProvider=AbstractProcessProvider.findProcessProviderFromPID(IComponent.JOBLET_PID);
      if (pProvider != null && !pProvider.canCopyNode((Node)((NodePart)o).getModel())) {
        return false;
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  List objects=getSelectedObjects();
  if (!objects.isEmpty()) {
    for (    Object o : objects) {
      if (o instanceof NoteEditPart) {
        return true;
      }
      if (o instanceof NodeLabelEditPart) {
        return true;
      }
      if (o instanceof ConnLabelEditPart) {
        return true;
      }
      if (o instanceof SubjobContainerPart) {
        return true;
      }
      if (!(o instanceof NodePart) && !(o instanceof NoteEditPart)) {
        return false;
      }
      AbstractProcessProvider pProvider=AbstractProcessProvider.findProcessProviderFromPID(IComponent.JOBLET_PID);
      if (pProvider != null && !pProvider.canCopyNode((Node)((NodePart)o).getModel())) {
        return false;
      }
    }
    return true;
  }
  return false;
}
Program: 122526
Project: 122526
Buggy source:
/** 
 * DOC hcyi Comment method "checkHasMultiPrejobOrPostJobComponents".
 */
private void checkHasMultiPrejobOrPostJobComponents(){
  if (PluginChecker.isJobLetPluginLoaded()) {
    IJobletProviderService jobletService=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
    if (jobletService != null) {
      if (jobletService.isJobletComponent(this)) {
        Map<String,INode> multiNodes=new HashMap<String,INode>();
        for (        INode node : process.getGeneratingNodes()) {
          String componentName=node.getComponent().getName();
          if (componentName != null && componentName.equals(TPREJOB_STR)) {
            if (!multiNodes.containsKey(TPREJOB_STR)) {
              multiNodes.put(TPREJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPREJOB_STR);
              Problems.add(ProblemStatus.ERROR,this,errorMessage);
            }
          }
          if (componentName != null && componentName.equals(TPOSTJOB_STR)) {
            if (!multiNodes.containsKey(TPOSTJOB_STR)) {
              multiNodes.put(TPOSTJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPOSTJOB_STR);
              Problems.add(ProblemStatus.ERROR,this,errorMessage);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC hcyi Comment method "checkHasMultiPrejobOrPostJobComponents".
 */
private void checkHasMultiPrejobOrPostJobComponents(){
  if (PluginChecker.isJobLetPluginLoaded()) {
    IJobletProviderService jobletService=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
    if (jobletService != null) {
      if (jobletService.isJobletComponent(this)) {
        Map<String,INode> multiNodes=new HashMap<String,INode>();
        for (        INode node : process.getGeneratingNodes()) {
          if (("String_Node_Str").equals(node.getUniqueName())) {
            continue;
          }
          String componentName=node.getComponent().getName();
          if (componentName != null && componentName.equals(TPREJOB_STR)) {
            if (!multiNodes.containsKey(TPREJOB_STR)) {
              multiNodes.put(TPREJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPREJOB_STR);
              Problems.add(ProblemStatus.ERROR,this,errorMessage);
            }
          }
          if (componentName != null && componentName.equals(TPOSTJOB_STR)) {
            if (!multiNodes.containsKey(TPOSTJOB_STR)) {
              multiNodes.put(TPOSTJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPOSTJOB_STR);
              Problems.add(ProblemStatus.ERROR,this,errorMessage);
            }
          }
        }
      }
    }
  }
}
Program: 122527
Project: 122527
Buggy source:
/** 
 * DOC hcyi Comment method "checkHasMultiPrejobOrPostJobComponents".
 */
private void checkHasMultiPrejobOrPostJobComponents(){
  if (PluginChecker.isJobLetPluginLoaded()) {
    IJobletProviderService jobletService=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
    if (jobletService != null) {
      if (jobletService.isJobletComponent(this)) {
        Map<String,INode> multiNodes=new HashMap<String,INode>();
        for (        INode node : process.getGeneratingNodes()) {
          String componentName=node.getComponent().getName();
          if (componentName != null && componentName.equals(TPREJOB_STR)) {
            if (!multiNodes.containsKey(TPREJOB_STR)) {
              multiNodes.put(TPREJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPREJOB_STR);
              Problems.add(ProblemStatus.ERROR,this,errorMessage);
            }
          }
          if (componentName != null && componentName.equals(TPOSTJOB_STR)) {
            if (!multiNodes.containsKey(TPOSTJOB_STR)) {
              multiNodes.put(TPOSTJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPOSTJOB_STR);
              Problems.add(ProblemStatus.ERROR,this,errorMessage);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC hcyi Comment method "checkHasMultiPrejobOrPostJobComponents".
 */
private void checkHasMultiPrejobOrPostJobComponents(){
  if (PluginChecker.isJobLetPluginLoaded()) {
    IJobletProviderService jobletService=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
    if (jobletService != null) {
      if (jobletService.isJobletComponent(this)) {
        Map<String,INode> multiNodes=new HashMap<String,INode>();
        for (        INode node : process.getGeneratingNodes()) {
          if (("String_Node_Str").equals(node.getUniqueName())) {
            continue;
          }
          String componentName=node.getComponent().getName();
          if (componentName != null && componentName.equals(TPREJOB_STR)) {
            if (!multiNodes.containsKey(TPREJOB_STR)) {
              multiNodes.put(TPREJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPREJOB_STR);
              Problems.add(ProblemStatus.ERROR,this,errorMessage);
            }
          }
          if (componentName != null && componentName.equals(TPOSTJOB_STR)) {
            if (!multiNodes.containsKey(TPOSTJOB_STR)) {
              multiNodes.put(TPOSTJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPOSTJOB_STR);
              Problems.add(ProblemStatus.ERROR,this,errorMessage);
            }
          }
        }
      }
    }
  }
}
Program: 122533
Project: 122533
Buggy source:
public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort,proxyUser,proxyPassword);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,password);
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=project.getAuthor().getLogin();
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ password);
      okPressed();
    }
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort,proxyUser,proxyPassword);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,password);
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=null;
      if (project.getAuthor() != null) {
        connectionEmail=project.getAuthor().getLogin();
      }
 else {
        connectionEmail="String_Node_Str";
      }
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ password);
      okPressed();
    }
  }
}
Program: 122534
Project: 122534
Buggy source:
public void linkActivated(HyperlinkEvent e){
  stackLayout.topControl=createAccount;
  downComposite.layout();
}

Fixed version (ground truth):
@Override public void linkActivated(HyperlinkEvent e){
  stackLayout.topControl=createAccount;
  downComposite.layout();
}
Program: 122536
Project: 122536
Buggy source:
protected void initializeBounds(){
  super.initializeBounds();
  Point location=getInitialLocation(getShell().getSize());
  getShell().setLocation(location.x,location.y);
}

Fixed version (ground truth):
@Override protected void initializeBounds(){
  super.initializeBounds();
  Point location=getInitialLocation(getShell().getSize());
  getShell().setLocation(location.x,location.y);
}
Program: 122539
Project: 122539
Buggy source:
public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort,proxyUser,proxyPassword);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,password);
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=project.getAuthor().getLogin();
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ password);
      okPressed();
    }
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort,proxyUser,proxyPassword);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,password);
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=null;
      if (project.getAuthor() != null) {
        connectionEmail=project.getAuthor().getLogin();
      }
 else {
        connectionEmail="String_Node_Str";
      }
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ password);
      okPressed();
    }
  }
}