nus-yam/ex-repair huggingface dataset:
Program: 118875
Project: 118875
Buggy source:
public GenericElementParameter(IElement element,ComponentProperties componentProperties,Widget widget,ComponentService componentService){
  super(element);
  this.componentProperties=componentProperties;
  this.widget=widget;
  this.componentService=componentService;
  isFirstCall=true;
  callBefore();
}

Fixed version (ground truth):
public GenericElementParameter(IElement element,ComponentProperties componentProperties,Widget widget,ComponentService componentService){
  super(element);
  this.componentProperties=componentProperties;
  this.widget=widget;
  this.componentService=componentService;
  isFirstCall=true;
  NamedThing[] widgetProperties=widget.getProperties();
  NamedThing widgetProperty=widgetProperties[0];
  setName(widgetProperty.getName());
  setDisplayName(widgetProperty.getDisplayName());
  callBefore();
}
Program: 118877
Project: 118877
Buggy source:
protected String getNodeLabel(){
  return repositoryNode.getContentType().getLabel();
}

Fixed version (ground truth):
protected String getNodeLabel(){
  return repObjType.getLabel();
}
Program: 118878
Project: 118878
Buggy source:
public CreateGenericConnectionAction(){
  super();
  if (repositoryNode == null) {
    repositoryNode=getCurrentRepositoryNode();
  }
  connectionTester=new GenericConnectionTester();
  this.setText(getCreateLabel());
  this.setToolTipText(getEditLabel());
  Image nodeImage=getNodeImage();
  if (nodeImage != null) {
    this.setImageDescriptor(ImageDescriptor.createFromImage(nodeImage));
  }
}

Fixed version (ground truth):
public CreateGenericConnectionAction(){
  super();
  if (repositoryNode == null) {
    repositoryNode=getCurrentRepositoryNode();
  }
  connectionTester=new GenericConnectionTester();
  repObjType=(ERepositoryObjectType)repositoryNode.getProperties(EProperties.CONTENT_TYPE);
  this.setText(getCreateLabel());
  this.setToolTipText(getEditLabel());
  Image nodeImage=getNodeImage();
  if (nodeImage != null) {
    this.setImageDescriptor(ImageDescriptor.createFromImage(nodeImage));
  }
}
Program: 118879
Project: 118879
Buggy source:
protected Image getNodeImage(){
  if (connectionTester.isGenericConnection(repositoryNode)) {
    return GenericWizardServiceFactory.getGenericWizardService().getNodeImage(repositoryNode.getContentType().getType());
  }
  return null;
}

Fixed version (ground truth):
protected Image getNodeImage(){
  if (connectionTester.isGenericConnection(repositoryNode)) {
    return GenericWizardServiceFactory.getGenericWizardService().getNodeImage(repObjType.getType());
  }
  return null;
}
Program: 118880
Project: 118880
Buggy source:
@Override public ComponentProperties getPropertiesForComponent(String arg0){
  return null;
}

Fixed version (ground truth):
@Override public ComponentProperties getPropertiesForComponent(String componentId){
  return null;
}
Program: 118881
Project: 118881
Buggy source:
@Override public void addPages(){
  String typeName=repNode.getContentType().getType();
  setWindowTitle(typeName);
  Image wiardImage=wizardService.getWiardImage(typeName);
  setDefaultPageImageDescriptor(ImageDescriptor.createFromImage(wiardImage));
  ((GenericConnectionItem)connectionItem).setTypeName(typeName);
  IGenericWizardInternalService internalService=new GenericWizardInternalService();
  ComponentWizard componentWizard=null;
  if (creation) {
    componentWizard=internalService.getComponentWizard(typeName,null);
  }
 else {
    String compPropertiesStr=connection.getCompProperties();
    if (compPropertiesStr != null) {
      Deserialized fromSerialized=ComponentProperties.fromSerialized(compPropertiesStr);
      if (fromSerialized != null) {
        componentWizard=internalService.getTopLevelComponentWizard(fromSerialized.properties,null);
      }
    }
  }
  if (componentWizard == null) {
    return;
  }
  List<Form> forms=componentWizard.getForms();
  for (  Form form : forms) {
    wizPage=new GenericConnWizardPage(connectionItem,isRepositoryObjectEditable(),existingNames,creation,form,compService);
    if (wizPage != null) {
      wizPage.setTitle(form.getTitle());
      wizPage.setDescription(form.getSubtitle());
      if (creation) {
        wizPage.setPageComplete(false);
      }
 else {
        wizPage.setPageComplete(isRepositoryObjectEditable());
      }
    }
    addPage(wizPage);
  }
}

Fixed version (ground truth):
@Override public void addPages(){
  ERepositoryObjectType repObjType=(ERepositoryObjectType)repNode.getProperties(EProperties.CONTENT_TYPE);
  String typeName=repObjType.getType();
  setWindowTitle(typeName);
  Image wiardImage=wizardService.getWiardImage(typeName);
  setDefaultPageImageDescriptor(ImageDescriptor.createFromImage(wiardImage));
  ((GenericConnectionItem)connectionItem).setTypeName(typeName);
  IGenericWizardInternalService internalService=new GenericWizardInternalService();
  ComponentWizard componentWizard=null;
  if (creation) {
    componentWizard=internalService.getComponentWizard(typeName,null);
  }
 else {
    String compPropertiesStr=connection.getCompProperties();
    if (compPropertiesStr != null) {
      Deserialized fromSerialized=ComponentProperties.fromSerialized(compPropertiesStr);
      if (fromSerialized != null) {
        componentWizard=internalService.getTopLevelComponentWizard(fromSerialized.properties,null);
      }
    }
  }
  if (componentWizard == null) {
    return;
  }
  List<Form> forms=componentWizard.getForms();
  for (  Form form : forms) {
    wizPage=new GenericConnWizardPage(connectionItem,isRepositoryObjectEditable(),existingNames,creation,form,compService);
    if (wizPage != null) {
      wizPage.setTitle(form.getTitle());
      wizPage.setDescription(form.getSubtitle());
      if (creation) {
        wizPage.setPageComplete(false);
      }
 else {
        wizPage.setPageComplete(isRepositoryObjectEditable());
      }
    }
    addPage(wizPage);
  }
}
Program: 118883
Project: 118883
Buggy source:
@Override public Image getImage(Object element){
  if (element instanceof RepositoryNode) {
    RepositoryNode node=(RepositoryNode)element;
    return GenericWizardServiceFactory.getGenericWizardService().getNodeImage(node.getContentType().getType());
  }
  return super.getImage(element);
}

Fixed version (ground truth):
@Override public Image getImage(Object element){
  if (element instanceof RepositoryNode) {
    RepositoryNode node=(RepositoryNode)element;
    ERepositoryObjectType repObjType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    return GenericWizardServiceFactory.getGenericWizardService().getNodeImage(repObjType.getType());
  }
  return super.getImage(element);
}
Program: 118885
Project: 118885
Buggy source:
@Override public void refresh(){
  if (getAuthor() != null && getAuthor().getLogin() != null) {
    authorText.setText(getAuthor().getLogin());
  }
 else {
    authorText.setText("String_Node_Str");
  }
  lockerText.setText(ProxyRepositoryFactory.getInstance().getLockInfo(getObject().getProperty().getItem()).getUser());
  versionText.setText(getVersion() == null ? "String_Node_Str" : getVersion());
}

Fixed version (ground truth):
@Override public void refresh(){
  if (getAuthor() != null && getAuthor().getLogin() != null) {
    authorText.setText(getAuthor().getLogin());
  }
 else {
    authorText.setText("String_Node_Str");
  }
  String locker="String_Node_Str";
  LockInfo lockInfo=getLockInfo();
  if (lockInfo != null) {
    locker=lockInfo.getUser();
  }
  lockerText.setText(locker);
  versionText.setText(getVersion() == null ? "String_Node_Str" : getVersion());
}
Program: 118887
Project: 118887
Buggy source:
@Override public List<ElementParameter> createElementParameters(INode node){
  List<ElementParameter> listParam;
  listParam=new ArrayList<ElementParameter>();
  addPropertyParameters(listParam,node,NORMAL_PROPERTY);
  addPropertyParameters(listParam,node,ADVANCED_PROPERTY);
  return listParam;
}

Fixed version (ground truth):
@Override public List<ElementParameter> createElementParameters(INode node){
  List<ElementParameter> listParam;
  listParam=new ArrayList<ElementParameter>();
  addMainParameters(listParam,node);
  addPropertyParameters(listParam,node,NORMAL_PROPERTY);
  addPropertyParameters(listParam,node,ADVANCED_PROPERTY);
  return listParam;
}
Program: 118888
Project: 118888
Buggy source:
public static void loadComponents(ComponentService service){
  IComponentsFactory componentsFactory=null;
  if (componentsFactory == null) {
    componentsFactory=ComponentsFactoryProvider.getInstance();
  }
  Set<IComponent> componentsList=componentsFactory.getComponents();
  if (components == null) {
    components=new ArrayList<IComponent>();
  }
 else {
    componentsList.removeAll(components);
  }
  Map<String,IComponent> existComponents=new HashMap<String,IComponent>();
  for (  IComponent component : componentsList) {
    existComponents.put(component.getName(),component);
  }
  Set<ComponentDefinition> componentDefinitions=service.getAllComponents();
  for (  ComponentDefinition componentDefinition : componentDefinitions) {
    try {
      Component currentComponent=new Component(componentDefinition);
      componentsList.add(currentComponent);
    }
 catch (    BusinessException e) {
      e.printStackTrace();
    }
  }
  Set<String> componentNames=service.getAllComponentNames();
  for (  String componentName : componentNames) {
    ComponentProperties componentProperty=service.getComponentProperties(componentName);
  }
}

Fixed version (ground truth):
public static void loadComponents(ComponentService service){
  IComponentsFactory componentsFactory=null;
  if (componentsFactory == null) {
    componentsFactory=ComponentsFactoryProvider.getInstance();
  }
  Set<IComponent> componentsList=componentsFactory.getComponents();
  if (components == null) {
    components=new ArrayList<IComponent>();
  }
 else {
    componentsList.removeAll(components);
  }
  Map<String,IComponent> existComponents=new HashMap<String,IComponent>();
  for (  IComponent component : componentsList) {
    existComponents.put(component.getName(),component);
  }
  Set<ComponentDefinition> componentDefinitions=service.getAllComponents();
  for (  ComponentDefinition componentDefinition : componentDefinitions) {
    try {
      Component currentComponent=new Component(componentDefinition);
      componentsList.add(currentComponent);
    }
 catch (    BusinessException e) {
      e.printStackTrace();
    }
  }
  Set<String> componentNames=service.getAllComponentNames();
  for (  String componentName : componentNames) {
  }
}
Program: 118890
Project: 118890
Buggy source:
@Override public void setValue(Object o){
  super.setValue(o);
  if (!isFirstCall) {
    updateProperty(o);
    callValidate();
    callAfter();
    fireChangedIfNeeded();
  }
  isFirstCall=false;
}

Fixed version (ground truth):
@Override public void setValue(Object o){
  super.setValue(o);
  if (!isFirstCall) {
    updateProperty(o);
    boolean calledValidate=callValidate();
    boolean calledAfter=callAfter();
    if (calledValidate || calledAfter) {
      fireChangedIfNeeded();
    }
  }
  isFirstCall=false;
}
Program: 118891
Project: 118891
Buggy source:
private void callAfter(){
  if (widget.isCallAfter()) {
    try {
      componentProperties=componentService.afterProperty(getName(),componentProperties);
    }
 catch (    Throwable e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
private boolean callAfter(){
  if (widget.isCallAfter()) {
    try {
      componentProperties=componentService.afterProperty(getName(),componentProperties);
      return true;
    }
 catch (    Throwable e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}
Program: 118892
Project: 118892
Buggy source:
private void callValidate(){
  if (widget.isCallValidate()) {
    try {
      componentProperties=componentService.validateProperty(getName(),componentProperties);
    }
 catch (    Throwable e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
private boolean callValidate(){
  if (widget.isCallValidate()) {
    try {
      componentProperties=componentService.validateProperty(getName(),componentProperties);
      return true;
    }
 catch (    Throwable e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}
Program: 118893
Project: 118893
Buggy source:
private void callBefore(){
  if (widget.isCallBefore()) {
    try {
      componentProperties=componentService.beforeProperty(getName(),componentProperties);
    }
 catch (    Throwable e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
private boolean callBefore(){
  if (widget.isCallBefore()) {
    try {
      componentProperties=componentService.beforeProperty(getName(),componentProperties);
      return true;
    }
 catch (    Throwable e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}
Program: 118896
Project: 118896
Buggy source:
@Override public void partBroughtToTop(IWorkbenchPart part){
  IProcess2 process=getJobFromActivatedEditor(part);
  if (process != null && currentProcess != process) {
    changedProcess=true;
    currentProcess=process;
    Contexts.setTitle(process.getLabel());
    setContextsView(process);
    JobSettings.switchToCurJobSettingsView();
    refreshProcessView();
    for (    IJobTrackerListener listener : jobTrackerListeners) {
      listener.focusOnJob(process);
    }
  }
}

Fixed version (ground truth):
@Override public void partBroughtToTop(IWorkbenchPart part){
  IProcess2 process=getJobFromActivatedEditor(part);
  if (process != null && currentProcess != process) {
    changedProcess=true;
    currentProcess=process;
    Contexts.setTitle(process.getLabel());
    setContextsView(process,part);
    JobSettings.switchToCurJobSettingsView();
    refreshProcessView();
    for (    IJobTrackerListener listener : jobTrackerListeners) {
      listener.focusOnJob(process);
    }
  }
}
Program: 118897
Project: 118897
Buggy source:
/** 
 * qzhang Comment method "setProblemsView".
 * @param process
 */
private void setContextsView(IProcess2 process){
  IRunProcessService service=DesignerPlugin.getDefault().getRunProcessService();
  service.setActiveProcess(process,true);
  Contexts.switchToCurContextsView();
}

Fixed version (ground truth):
/** 
 * qzhang Comment method "setProblemsView".
 * @param process
 */
private void setContextsView(IProcess2 process,IWorkbenchPart part){
  IRunProcessService service=DesignerPlugin.getDefault().getRunProcessService();
  service.setActiveProcess(process,true);
  Contexts.switchToCurContextsView(part);
}
Program: 118901
Project: 118901
Buggy source:
private void mavenBuildCodeProjectPom(String goals,String module,Map<String,Object> argumentsMap,IProgressMonitor monitor) throws Exception {
  IFile childModulePomFile;
  if (TalendMavenConstants.CURRENT_PATH.equals(module)) {
    childModulePomFile=this.getProject().getFile(TalendMavenConstants.POM_FILE_NAME);
  }
 else {
    IFolder moduleFolder=this.getProject().getFolder(module);
    childModulePomFile=moduleFolder.getFile(TalendMavenConstants.POM_FILE_NAME);
  }
  if (childModulePomFile.getLocation().toFile().exists()) {
    MavenPomCommandLauncher mavenLauncher=null;
    if (goals == null || goals.trim().length() == 0 || goals.equals(TalendMavenConstants.GOAL_COMPILE)) {
      mavenLauncher=new MavenPomCommandLauncher(childModulePomFile,TalendMavenConstants.GOAL_REFRESH);
      mavenLauncher.setArgumentsMap(argumentsMap);
      mavenLauncher.execute(monitor);
    }
 else {
      mavenLauncher=new MavenPomCommandLauncher(childModulePomFile,goals);
      mavenLauncher.setArgumentsMap(argumentsMap);
      mavenLauncher.execute(monitor);
    }
    buildWholeCodeProject();
  }
 else {
    throw new RuntimeException("String_Node_Str" + module);
  }
}

Fixed version (ground truth):
private void mavenBuildCodeProjectPom(String goals,String module,Map<String,Object> argumentsMap,IProgressMonitor monitor) throws Exception {
  IFile childModulePomFile;
  if (TalendMavenConstants.CURRENT_PATH.equals(module)) {
    childModulePomFile=this.getProject().getFile(TalendMavenConstants.POM_FILE_NAME);
  }
 else {
    IFolder moduleFolder=this.getProject().getFolder(module);
    childModulePomFile=moduleFolder.getFile(TalendMavenConstants.POM_FILE_NAME);
  }
  if (childModulePomFile.getLocation().toFile().exists()) {
    MavenPomCommandLauncher mavenLauncher=null;
    if (goals == null || goals.trim().length() == 0 || goals.equals(TalendMavenConstants.GOAL_COMPILE)) {
      mavenLauncher=new MavenPomCommandLauncher(childModulePomFile,TalendMavenConstants.GOAL_REFRESH);
      mavenLauncher.setArgumentsMap(argumentsMap);
      mavenLauncher.execute(monitor);
    }
 else {
      mavenLauncher=new MavenPomCommandLauncher(childModulePomFile,goals);
      mavenLauncher.setArgumentsMap(argumentsMap);
      mavenLauncher.execute(monitor);
    }
    buildWholeCodeProject();
    buildWholeCodeProject();
  }
 else {
    throw new RuntimeException("String_Node_Str" + module);
  }
}
Program: 118902
Project: 118902
Buggy source:
@Override public void buildModules(IProgressMonitor monitor,String[] childrenModules,Map<String,Object> argumentsMap) throws Exception {
  String goals=null;
  if (argumentsMap != null) {
    goals=(String)argumentsMap.get(TalendProcessArgumentConstant.ARG_GOAL);
  }
  if (childrenModules == null) {
    if (goals != null && goals.trim().length() > 0) {
      mavenBuildCodeProjectPom(goals,TalendMavenConstants.CURRENT_PATH,argumentsMap,monitor);
    }
 else {
      buildWholeCodeProject();
    }
  }
 else   if (childrenModules.length > 0) {
    for (    String module : childrenModules) {
      IPath modulePath=new Path(module);
      if (modulePath.lastSegment().equals(TalendMavenConstants.POM_FILE_NAME)) {
        modulePath=modulePath.removeLastSegments(1);
      }
      String newModule=modulePath.toString();
      mavenBuildCodeProjectPom(goals,newModule,argumentsMap,monitor);
    }
  }
 else {
  }
}

Fixed version (ground truth):
@Override public void buildModules(IProgressMonitor monitor,String[] childrenModules,Map<String,Object> argumentsMap) throws Exception {
  String goals=null;
  if (argumentsMap != null) {
    goals=(String)argumentsMap.get(TalendProcessArgumentConstant.ARG_GOAL);
  }
  if (childrenModules == null) {
    if (goals != null && goals.trim().length() > 0) {
      mavenBuildCodeProjectPom(goals,TalendMavenConstants.CURRENT_PATH,argumentsMap,monitor);
    }
 else {
      buildWholeCodeProject();
      buildWholeCodeProject();
    }
  }
 else   if (childrenModules.length > 0) {
    for (    String module : childrenModules) {
      IPath modulePath=new Path(module);
      if (modulePath.lastSegment().equals(TalendMavenConstants.POM_FILE_NAME)) {
        modulePath=modulePath.removeLastSegments(1);
      }
      String newModule=modulePath.toString();
      mavenBuildCodeProjectPom(goals,newModule,argumentsMap,monitor);
    }
  }
 else {
  }
}
Program: 118903
Project: 118903
Buggy source:
/** 
 * yzhang Comment method "getFilterRegex".
 * @return
 */
private static String getFilterRegex(String nameFilter){
  String regex="String_Node_Str" + nameFilter.replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str";
  regex=regex.replaceAll("String_Node_Str","String_Node_Str");
  regex=regex.replaceAll("String_Node_Str","String_Node_Str");
  try {
    Pattern.compile(regex);
  }
 catch (  Throwable e) {
    regex=nameFilter;
  }
  return regex;
}

Fixed version (ground truth):
/** 
 * yzhang Comment method "getFilterRegex".
 * @return
 */
private static String getFilterRegex(String nameFilter){
  String regex="String_Node_Str" + nameFilter.replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str";
  regex=regex.replaceAll("String_Node_Str","String_Node_Str");
  regex=regex.replaceAll("String_Node_Str","String_Node_Str");
  regex=regex.replaceAll("String_Node_Str","String_Node_Str");
  try {
    Pattern.compile(regex);
  }
 catch (  Throwable e) {
    regex="String_Node_Str";
    CommonExceptionHandler.process(e,Priority.WARN);
  }
  return regex;
}
Program: 118904
Project: 118904
Buggy source:
private void runProcessContextChanged(final PropertyChangeEvent evt){
  if (isDisposed()) {
    return;
  }
  String propName=evt.getPropertyName();
  if (RunProcessContext.MEMORY_MONITOR.equals(propName)) {
    getDisplay().asyncExec(new Runnable(){
      @Override public void run(){
        if (isDisposed()) {
          return;
        }
        boolean monitoring=((Boolean)evt.getNewValue()).booleanValue();
        if (runtimeButton != null && !runtimeButton.isDisposed()) {
          setRuntimeButtonByStatus(processContext != null && processContext.isRunning());
          if (processContext == null) {
            setRuntimeButtonByStatus(false);
          }
 else           if (processContext.isRunning()) {
            setRuntimeButtonByStatus(false);
          }
 else {
            disconnectJVM();
            setRuntimeButtonByStatus(true);
            processContext.setMonitoring(false);
            String content=getExecutionInfo("String_Node_Str");
            messageManager.setEndMessage(content,getDisplay().getSystemColor(SWT.COLOR_BLUE),getDisplay().getSystemColor(SWT.COLOR_WHITE));
            ((RuntimeGraphcsComposite)chartComposite).displayReportField();
            lock=false;
          }
        }
        if (!monitoring && chartComposite != null && chartComposite.isDisposed()) {
          viewPart.setSelection(null);
          refreshMonitorComposite();
        }
      }
    }
);
  }
}

Fixed version (ground truth):
private void runProcessContextChanged(final PropertyChangeEvent evt){
  if (isDisposed()) {
    return;
  }
  String propName=evt.getPropertyName();
  if (RunProcessContext.MEMORY_MONITOR.equals(propName)) {
    getDisplay().asyncExec(new Runnable(){
      @Override public void run(){
        if (isDisposed()) {
          return;
        }
        boolean monitoring=((Boolean)evt.getNewValue()).booleanValue();
        if (runtimeButton != null && !runtimeButton.isDisposed()) {
          setRuntimeButtonByStatus(processContext != null && processContext.isRunning());
          if (processContext == null) {
            setRuntimeButtonByStatus(false);
          }
 else           if (processContext.isRunning()) {
            setRuntimeButtonByStatus(false);
          }
 else {
            disconnectJVM();
            setRuntimeButtonByStatus(true);
            processContext.setMonitoring(false);
            if (AbstractRuntimeGraphcsComposite.isMonitoring()) {
              AbstractRuntimeGraphcsComposite.setMonitoring(false);
              String content=getExecutionInfo("String_Node_Str");
              messageManager.setEndMessage(content,getDisplay().getSystemColor(SWT.COLOR_BLUE),getDisplay().getSystemColor(SWT.COLOR_WHITE));
            }
            ((RuntimeGraphcsComposite)chartComposite).displayReportField();
            lock=false;
          }
        }
        if (!monitoring && chartComposite != null && chartComposite.isDisposed()) {
          viewPart.setSelection(null);
          refreshMonitorComposite();
        }
      }
    }
);
  }
}
Program: 118906
Project: 118906
Buggy source:
private void setNormalReport(Date lastDate){
  if (reportField != null && !reportField.isDisposed()) {
    StringBuilder finalContent=new StringBuilder();
    finalContent.append(reportField.getText());
    finalContent.append("String_Node_Str");
    finalContent.append(Messages.memoryNormalMsg);
    finalContent.append("String_Node_Str");
    finalContent.append(lastDate.toString());
    reportField.setText(finalContent.toString());
    reportField.setForeground(new Color(Display.getDefault(),0,0,0));
    reportField.setTopIndex(Integer.MAX_VALUE);
  }
}

Fixed version (ground truth):
private void setNormalReport(Date lastDate){
  if (reportField != null && !reportField.isDisposed()) {
    StringBuilder finalContent=new StringBuilder();
    finalContent.append(reportField.getText());
    finalContent.append(System.getProperty("String_Node_Str"));
    finalContent.append(Messages.memoryNormalMsg);
    finalContent.append("String_Node_Str");
    finalContent.append(lastDate.toString());
    reportField.setText(finalContent.toString());
    reportField.setForeground(new Color(Display.getDefault(),0,0,0));
    reportField.setTopIndex(Integer.MAX_VALUE);
  }
}
Program: 118908
Project: 118908
Buggy source:
private synchronized void setWarningReport(Date lastDate){
  if (messageManager != null) {
    StringBuilder finalContent=new StringBuilder();
    finalContent.append(Messages.memoryWarningMsg);
    finalContent.append("String_Node_Str");
    finalContent.append(new SimpleDateFormat("String_Node_Str").format(lastDate));
    finalContent.append("String_Node_Str");
    messageManager.setWarningMessage(finalContent.toString(),getDisplay().getSystemColor(SWT.COLOR_RED),getDisplay().getSystemColor(SWT.COLOR_WHITE));
  }
  displayReportField();
}

Fixed version (ground truth):
private synchronized void setWarningReport(Date lastDate){
  if (messageManager != null) {
    StringBuilder finalContent=new StringBuilder();
    finalContent.append(Messages.memoryWarningMsg);
    finalContent.append("String_Node_Str");
    finalContent.append(new SimpleDateFormat("String_Node_Str").format(lastDate));
    finalContent.append(System.getProperty("String_Node_Str"));
    messageManager.setWarningMessage(finalContent.toString(),getDisplay().getSystemColor(SWT.COLOR_RED),getDisplay().getSystemColor(SWT.COLOR_WHITE));
  }
  displayReportField();
}
Program: 118909
Project: 118909
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  if (messageManager == null || messageManager.getMessages().size() < 1) {
    MessageDialog.openWarning(getShell(),"String_Node_Str","String_Node_Str");
    return;
  }
  UnboundedFifoBuffer messages=messageManager.getMessages();
  Iterator iterator=messages.iterator();
  StringBuilder content=new StringBuilder();
  while (iterator.hasNext()) {
    ReportMessage message=(ReportMessage)iterator.next();
    content.append(message.getContent());
  }
  String[] msg=content.toString().split("String_Node_Str");
  if (!msg[msg.length - 1].startsWith("String_Node_Str")) {
    MessageDialog.openWarning(getShell(),"String_Node_Str","String_Node_Str");
    return;
  }
  FileDialog dialog=new FileDialog(getShell(),SWT.SAVE);
  dialog.setFilterPath("String_Node_Str");
  String fileName=dialog.open();
  if (fileName != null) {
    FileWriter writer=null;
    try {
      writer=new FileWriter(fileName);
      writer.write(content.toString());
    }
 catch (    IOException e1) {
      e1.printStackTrace();
    }
 finally {
      try {
        if (writer != null) {
          writer.close();
        }
      }
 catch (      IOException e1) {
        e1.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  if (messageManager == null || messageManager.getMessages().size() < 1) {
    MessageDialog.openWarning(getShell(),"String_Node_Str","String_Node_Str");
    return;
  }
  UnboundedFifoBuffer messages=messageManager.getMessages();
  Iterator iterator=messages.iterator();
  StringBuilder content=new StringBuilder();
  while (iterator.hasNext()) {
    ReportMessage message=(ReportMessage)iterator.next();
    content.append(message.getContent());
  }
  if (isMonitoring) {
    MessageDialog.openWarning(getShell(),"String_Node_Str","String_Node_Str");
    return;
  }
  FileDialog dialog=new FileDialog(getShell(),SWT.SAVE);
  dialog.setFilterPath("String_Node_Str");
  String fileName=dialog.open();
  if (fileName != null) {
    FileWriter writer=null;
    try {
      writer=new FileWriter(fileName);
      writer.write(content.toString());
    }
 catch (    IOException e1) {
      e1.printStackTrace();
    }
 finally {
      try {
        if (writer != null) {
          writer.close();
        }
      }
 catch (      IOException e1) {
        e1.printStackTrace();
      }
    }
  }
}
Program: 118910
Project: 118910
Buggy source:
protected void recordFirstConnection(){
  if (storedConnections != null) {
    for (    ConnectionBean connectionBean : storedConnections) {
      if (connectionBean.getName().equals(lastConnection)) {
        firstConnBean=connectionBean;
        break;
      }
    }
  }
}

Fixed version (ground truth):
protected void recordFirstConnection(){
  firstConnBean=getConnectionBeanByName(storedConnections,lastConnection);
}
Program: 118911
Project: 118911
Buggy source:
public void saveConnections(List<ConnectionBean> connectionsBeans){
  perReader.saveConnections(connectionsBeans);
}

Fixed version (ground truth):
public void saveConnections(List<ConnectionBean> connectionsBeans){
  perReader.saveConnections(connectionsBeans);
  if (connectionsBeans != storedConnections) {
    setStoredConnections(connectionsBeans);
  }
}
Program: 118912
Project: 118912
Buggy source:
public void setStoredConnections(List<ConnectionBean> storedConnections){
  this.storedConnections=storedConnections;
}

Fixed version (ground truth):
public void setStoredConnections(List<ConnectionBean> storedConnections){
  this.storedConnections=storedConnections;
  if (currentSelectedConnBean != null) {
    currentSelectedConnBean=getConnectionBeanByName(this.storedConnections,currentSelectedConnBean.getName());
    if (currentSelectedConnBean == null) {
      currentSelectedConnBean=getConnectionBeanByName(this.storedConnections,lastConnection);
    }
  }
}
Program: 118913
Project: 118913
Buggy source:
public void saveLastConnectionBean(ConnectionBean connBean){
  perReader.saveLastConnectionBean(connBean);
}

Fixed version (ground truth):
public void saveLastConnectionBean(ConnectionBean connBean){
  perReader.saveLastConnectionBean(connBean);
  if (connBean != null) {
    lastConnection=connBean.getName();
  }
}
Program: 118916
Project: 118916
Buggy source:
/** 
 * Code Execution, used, when you know where the code stands.
 * @param Perl Absolute Code Path
 * @param Context Name
 * @param Port Statistics
 * @param Port Trace
 * @return Command Process Launched
 * @throws ProcessorException
 */
protected Process exec(Level level,int statOption,int traceOption,String... codeOptions) throws ProcessorException {
  String[] cmd=getCommandLine(true,false,statOption,traceOption,codeOptions);
  logCommandLine(cmd,level);
  try {
    return Runtime.getRuntime().exec(cmd);
  }
 catch (  IOException ioe) {
    throw new ProcessorException(Messages.getString("String_Node_Str"),ioe);
  }
}

Fixed version (ground truth):
protected Process exec(String[] cmd,String path) throws ProcessorException {
  try {
    if (path == null || !new File(path).exists()) {
      return Runtime.getRuntime().exec(cmd);
    }
 else {
      return Runtime.getRuntime().exec(cmd,null,new File(path));
    }
  }
 catch (  IOException ioe) {
    throw new ProcessorException(Messages.getString("String_Node_Str"),ioe);
  }
}
Program: 118917
Project: 118917
Buggy source:
protected Process execFrom(String path,Level level,int statOption,int traceOption,String... codeOptions) throws ProcessorException {
  String[] cmd=getCommandLine(true,false,statOption,traceOption,codeOptions);
  logCommandLine(cmd,level);
  try {
    return Runtime.getRuntime().exec(cmd,null,new File(path));
  }
 catch (  IOException ioe) {
    throw new ProcessorException(Messages.getString("String_Node_Str"),ioe);
  }
}

Fixed version (ground truth):
protected Process execFrom(String path,Level level,int statOption,int traceOption,String... codeOptions) throws ProcessorException {
  String[] cmd=getCommandLine(true,false,statOption,traceOption,codeOptions);
  logCommandLine(cmd,level);
  return exec(cmd,path);
}
Program: 118918
Project: 118918
Buggy source:
@Override public Process run(String[] optionsParam,int statisticsPort,int tracePort,IProgressMonitor monitor,IProcessMessageManager processMessageManager) throws ProcessorException {
  if (isStandardJob()) {
    Property property=this.getProperty();
    if (shouldRunAsExport() && property != null) {
      ProcessItem processItem=(ProcessItem)property.getItem();
      archive=buildExportZip(processItem,monitor);
      unzipFolder=unzipAndDeploy(process,archive);
      return super.execFrom(unzipFolder + File.separatorChar + process.getName(),Level.INFO,statisticsPort,tracePort,optionsParam);
    }
  }
  return super.run(optionsParam,statisticsPort,tracePort,monitor,processMessageManager);
}

Fixed version (ground truth):
@Override public Process run(String[] optionsParam,int statisticsPort,int tracePort,IProgressMonitor monitor,IProcessMessageManager processMessageManager) throws ProcessorException {
  if (isStandardJob()) {
    Property property=this.getProperty();
    if (isRunAsExport() && property != null) {
      ProcessItem processItem=(ProcessItem)property.getItem();
      archive=buildExportZip(processItem,monitor);
      unzipFolder=unzipAndDeploy(process,archive);
      return execFrom(unzipFolder + File.separatorChar + process.getName(),Level.INFO,statisticsPort,tracePort,optionsParam);
    }
  }
  return super.run(optionsParam,statisticsPort,tracePort,monitor,processMessageManager);
}
Program: 118919
Project: 118919
Buggy source:
protected String getLibsClasspath() throws ProcessorException {
  final boolean exportingJob=ProcessorUtilities.isExportConfig();
  final String classPathSeparator=extractClassPathSeparator();
  final String basePathClasspath=getBasePathClasspath();
  final String neededModulesJarStr=getNeededModulesJarStr();
  String libsStr=basePathClasspath + classPathSeparator + neededModulesJarStr.toString();
  if (exportingJob) {
    libsStr+=classPathSeparator + getExportJarsStr();
  }
 else {
    File libDir=JavaProcessorUtilities.getJavaProjectLibFolder();
    if (libDir != null) {
      String libFolder=new Path(libDir.getAbsolutePath()).toPortableString();
      libsStr+=classPathSeparator + libFolder;
    }
  }
  return libsStr;
}

Fixed version (ground truth):
protected String getLibsClasspath() throws ProcessorException {
  final String classPathSeparator=extractClassPathSeparator();
  final String basePathClasspath=getBasePathClasspath();
  final String neededModulesJarStr=getNeededModulesJarStr();
  String libsStr=basePathClasspath + classPathSeparator + neededModulesJarStr.toString();
  if (isExportConfig() || isRunAsExport()) {
    libsStr+=classPathSeparator + getExportJarsStr();
  }
 else {
    File libDir=JavaProcessorUtilities.getJavaProjectLibFolder();
    if (libDir != null) {
      String libFolder=new Path(libDir.getAbsolutePath()).toPortableString();
      libsStr+=classPathSeparator + libFolder;
    }
  }
  return libsStr;
}
Program: 118920
Project: 118920
Buggy source:
@Override public String[] getCommandLine() throws ProcessorException {
  List<String> tmpParams=new ArrayList<String>();
  tmpParams.add(getCommand());
  String[] proxyParameters=getProxyParameters();
  if (proxyParameters != null && proxyParameters.length > 0) {
    for (    String str : proxyParameters) {
      tmpParams.add(str);
    }
  }
  tmpParams.add(JavaUtils.JAVA_CP);
  tmpParams.add(getLibsClasspath());
  tmpParams.add(getMainClass());
  String[] additionCommandStrings=getAdditionCommandStrings();
  if (additionCommandStrings != null) {
    tmpParams.addAll(Arrays.asList(additionCommandStrings));
  }
  boolean exportingJob=ProcessorUtilities.isExportConfig();
  String[] cmd2=addVMArguments(tmpParams.toArray(new String[0]),exportingJob);
  if (exportingJob) {
    List<String> list=extractAheadCommandSegments();
    list.addAll(Arrays.asList(cmd2));
    return list.toArray(new String[0]);
  }
 else {
    return cmd2;
  }
}

Fixed version (ground truth):
@Override public String[] getCommandLine() throws ProcessorException {
  List<String> tmpParams=new ArrayList<String>();
  tmpParams.add(getCommand());
  String[] proxyParameters=getProxyParameters();
  if (proxyParameters != null && proxyParameters.length > 0) {
    for (    String str : proxyParameters) {
      tmpParams.add(str);
    }
  }
  tmpParams.add(JavaUtils.JAVA_CP);
  tmpParams.add(getLibsClasspath());
  tmpParams.add(getMainClass());
  String[] additionCommandStrings=getAdditionCommandStrings();
  if (additionCommandStrings != null) {
    tmpParams.addAll(Arrays.asList(additionCommandStrings));
  }
  String[] cmd2=addVMArguments(tmpParams.toArray(new String[0]));
  if (isExportConfig()) {
    List<String> list=extractAheadCommandSegments();
    list.addAll(Arrays.asList(cmd2));
    return list.toArray(new String[0]);
  }
 else {
    return cmd2;
  }
}
Program: 118921
Project: 118921
Buggy source:
public List<String> extractAheadCommandSegments(){
  List<String> aheadSegments=new ArrayList<String>();
  if (ProcessorUtilities.isExportConfig()) {
    if (isWinTargetPlatform()) {
      aheadSegments.add("String_Node_Str");
      aheadSegments.add("String_Node_Str");
    }
 else {
      aheadSegments.add("String_Node_Str");
      aheadSegments.add("String_Node_Str");
    }
  }
  return aheadSegments;
}

Fixed version (ground truth):
public List<String> extractAheadCommandSegments(){
  List<String> aheadSegments=new ArrayList<String>();
  if (isExportConfig()) {
    if (isWinTargetPlatform()) {
      aheadSegments.add("String_Node_Str");
      aheadSegments.add("String_Node_Str");
    }
 else {
      aheadSegments.add("String_Node_Str");
      aheadSegments.add("String_Node_Str");
    }
  }
  return aheadSegments;
}
Program: 118922
Project: 118922
Buggy source:
protected String[] addVMArguments(String[] strings,boolean exportingJob){
  String[] vmargs=getJVMArgs();
  RunProcessContext runProcessContext=RunProcessPlugin.getDefault().getRunProcessContextManager().getActiveContext();
  if (runProcessContext != null) {
    ITargetExecutionConfig config=runProcessContext.getSelectedTargetExecutionConfig();
    if (config != null && config.getCommandlineServerConfig() == null) {
      if (config.isRemote()) {
        if (config.isUseJMX()) {
          String[] jmxArg=new String[]{"String_Node_Str","String_Node_Str" + config.getRemotePort(),"String_Node_Str","String_Node_Str"};
          String[] _vmargs=new String[vmargs.length + jmxArg.length];
          System.arraycopy(vmargs,0,_vmargs,0,vmargs.length);
          System.arraycopy(jmxArg,0,_vmargs,vmargs.length,jmxArg.length);
          vmargs=_vmargs;
        }
      }
    }
  }
  if (vmargs != null && vmargs.length > 0) {
    String[] lines=new String[strings.length + vmargs.length];
    System.arraycopy(strings,0,lines,0,1);
    System.arraycopy(vmargs,0,lines,1,vmargs.length);
    System.arraycopy(strings,1,lines,vmargs.length + 1,strings.length - 1);
    return lines;
  }
  return strings;
}

Fixed version (ground truth):
protected String[] addVMArguments(String[] strings){
  String[] vmargs=getJVMArgs();
  RunProcessContext runProcessContext=RunProcessPlugin.getDefault().getRunProcessContextManager().getActiveContext();
  if (runProcessContext != null) {
    ITargetExecutionConfig config=runProcessContext.getSelectedTargetExecutionConfig();
    if (config != null && config.getCommandlineServerConfig() == null) {
      if (config.isRemote()) {
        if (config.isUseJMX()) {
          String[] jmxArg=new String[]{"String_Node_Str","String_Node_Str" + config.getRemotePort(),"String_Node_Str","String_Node_Str"};
          String[] _vmargs=new String[vmargs.length + jmxArg.length];
          System.arraycopy(vmargs,0,_vmargs,0,vmargs.length);
          System.arraycopy(jmxArg,0,_vmargs,vmargs.length,jmxArg.length);
          vmargs=_vmargs;
        }
      }
    }
  }
  if (vmargs != null && vmargs.length > 0) {
    String[] lines=new String[strings.length + vmargs.length];
    System.arraycopy(strings,0,lines,0,1);
    System.arraycopy(vmargs,0,lines,1,vmargs.length);
    System.arraycopy(strings,1,lines,vmargs.length + 1,strings.length - 1);
    return lines;
  }
  return strings;
}
Program: 118924
Project: 118924
Buggy source:
public String[] getJVMArgs(){
  String[] vmargs=getSettingsJVMArguments();
  if (!ProcessorUtilities.isExportConfig()) {
    String fileEncoding=System.getProperty("String_Node_Str");
    String encodingFromIni="String_Node_Str" + fileEncoding;
    List<String> asList=convertArgsToList(vmargs);
    boolean encodingSetInjob=false;
    for (    String arg : asList) {
      if (arg.startsWith("String_Node_Str") && fileEncoding != null) {
        arg=encodingFromIni;
        encodingSetInjob=true;
      }
    }
    if (!encodingSetInjob) {
      asList.add(encodingFromIni);
      vmargs=asList.toArray(new String[0]);
    }
  }
  return vmargs;
}

Fixed version (ground truth):
public String[] getJVMArgs(){
  String[] vmargs=getSettingsJVMArguments();
  if (!isExportConfig() && !isRunAsExport()) {
    String fileEncoding=System.getProperty("String_Node_Str");
    String encodingFromIni="String_Node_Str" + fileEncoding;
    List<String> asList=convertArgsToList(vmargs);
    boolean encodingSetInjob=false;
    for (    String arg : asList) {
      if (arg.startsWith("String_Node_Str") && fileEncoding != null) {
        arg=encodingFromIni;
        encodingSetInjob=true;
      }
    }
    if (!encodingSetInjob) {
      asList.add(encodingFromIni);
      vmargs=asList.toArray(new String[0]);
    }
  }
  return vmargs;
}
Program: 118926
Project: 118926
Buggy source:
protected String getCommand(){
  String command;
  try {
    command=getInterpreter();
  }
 catch (  ProcessorException e1) {
    command="String_Node_Str";
  }
  return new Path(command).toPortableString();
}

Fixed version (ground truth):
protected String getCommand(){
  if (isExportConfig() || isRunAsExport()) {
    return JavaUtils.JAVA_APP_NAME;
  }
  String command;
  try {
    command=getInterpreter();
  }
 catch (  ProcessorException e1) {
    command=JavaUtils.JAVA_APP_NAME;
  }
  return new Path(command).toPortableString();
}
Program: 118927
Project: 118927
Buggy source:
protected String getRootWorkingDir(boolean withSep){
  if (!isWinTargetPlatform() && (ProcessorUtilities.isExportConfig() || isExternalUse())) {
    if (withSep) {
      return ProcessorConstants.CMD_KEY_WORD_ROOTPATH + JavaUtils.PATH_SEPARATOR;
    }
 else {
      return ProcessorConstants.CMD_KEY_WORD_ROOTPATH;
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
protected String getRootWorkingDir(boolean withSep){
  if (!isWinTargetPlatform() && (isExportConfig() || isRunAsExport())) {
    if (withSep) {
      return ProcessorConstants.CMD_KEY_WORD_ROOTPATH + JavaUtils.PATH_SEPARATOR;
    }
 else {
      return ProcessorConstants.CMD_KEY_WORD_ROOTPATH;
    }
  }
  return "String_Node_Str";
}
Program: 118928
Project: 118928
Buggy source:
@Override public Boolean run() throws Throwable {
  ProxyRepositoryFactory.getInstance().initialize();
  return null;
}

Fixed version (ground truth):
@Override public Project[] run() throws Throwable {
  return ProxyRepositoryFactory.getInstance().readProject();
}
Program: 118930
Project: 118930
Buggy source:
protected void validateUpdate() throws JSONException {
  ConnectionBean currentBean=getConnection();
  String repositoryId=null;
  if (currentBean != null) {
    repositoryId=currentBean.getRepositoryId();
  }
  try {
    if (currentBean != null && isSVNProviderPluginLoadedRemote() && isWorkSpaceSame()) {
      if (afterUpdate) {
        refreshProjectOperationAreaEnable(false);
        errorManager.setErrMessage(Messages.getString("String_Node_Str"));
        changeFinishButtonAction(FINISH_ACTION_RESTART);
      }
 else {
        boolean needUpdate=LoginHelper.isStudioNeedUpdate(currentBean);
        if (needUpdate && isWorkSpaceSame()) {
          refreshProjectOperationAreaEnable(false);
          errorManager.setErrMessage(Messages.getString("String_Node_Str"));
          changeFinishButtonAction(FINISH_ACTION_UPDATE);
        }
      }
    }
  }
 catch (  PersistenceException e) {
    CommonExceptionHandler.process(e);
  }
catch (  SystemException e) {
    updateArchivaErrorButton();
  }
}

Fixed version (ground truth):
protected void validateUpdate() throws JSONException {
  final ConnectionBean currentBean=getConnection();
  String repositoryId=null;
  if (currentBean != null) {
    repositoryId=currentBean.getRepositoryId();
  }
  try {
    if (currentBean != null && isSVNProviderPluginLoadedRemote() && isWorkSpaceSame()) {
      if (afterUpdate) {
        refreshProjectOperationAreaEnable(false);
        errorManager.setErrMessage(Messages.getString("String_Node_Str"));
        changeFinishButtonAction(FINISH_ACTION_RESTART);
      }
 else {
        OverTimePopupDialogTask<Boolean> overTimePopupDialogTask=new OverTimePopupDialogTask<Boolean>(){
          @Override public Boolean run() throws Throwable {
            return LoginHelper.isStudioNeedUpdate(currentBean);
          }
        }
;
        overTimePopupDialogTask.setNeedWaitingProgressJob(false);
        boolean needUpdate=overTimePopupDialogTask.runTask();
        if (needUpdate && isWorkSpaceSame()) {
          refreshProjectOperationAreaEnable(false);
          errorManager.setErrMessage(Messages.getString("String_Node_Str"));
          changeFinishButtonAction(FINISH_ACTION_UPDATE);
        }
      }
    }
  }
 catch (  PersistenceException e) {
    CommonExceptionHandler.process(e);
  }
catch (  SystemException e) {
    updateArchivaErrorButton();
  }
catch (  Throwable e) {
    CommonExceptionHandler.process(e);
  }
}
Program: 118931
Project: 118931
Buggy source:
@Override public void cleanWorkingDirectory() throws SecurityException {
  log.debug("String_Node_Str" + archive);
  if (archive != null) {
    File archiveFile=new File(archive);
    if (archiveFile != null && archiveFile.exists()) {
      boolean success=archiveFile.delete();
      if (success) {
        log.debug("String_Node_Str" + archive + "String_Node_Str");
      }
    }
  }
  log.debug("String_Node_Str" + unzipFolder);
  if (unzipFolder != null) {
    boolean success=FilesUtils.removeFolder(unzipFolder,true);
    if (success) {
      log.debug("String_Node_Str" + unzipFolder + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void cleanWorkingDirectory() throws SecurityException {
  log.debug("String_Node_Str" + archive);
  if (archive != null) {
    File archiveFile=new File(archive);
    if (archiveFile != null && archiveFile.exists() && !CommonsPlugin.isDebugMode()) {
      boolean success=archiveFile.delete();
      if (success) {
        log.debug("String_Node_Str" + archive + "String_Node_Str");
      }
    }
  }
  log.debug("String_Node_Str" + unzipFolder);
  if (unzipFolder != null) {
    boolean success=FilesUtils.removeFolder(unzipFolder,true);
    if (success) {
      log.debug("String_Node_Str" + unzipFolder + "String_Node_Str");
    }
  }
}