nus-yam/ex-repair huggingface dataset:
Program: 127178
Project: 127178
Buggy source:
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random();
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}

Fixed version (ground truth):
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random(System.currentTimeMillis() + Thread.currentThread().getId() * 1000);
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}
Program: 127179
Project: 127179
Buggy source:
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random();
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}

Fixed version (ground truth):
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random(System.currentTimeMillis() + Thread.currentThread().getId() * 1000);
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}
Program: 127181
Project: 127181
Buggy source:
@Override public void run() throws PersistenceException {
  try {
    for (    String name : names) {
      String path=new Path(Platform.getInstanceLocation().getURL().getPath()).toFile().getPath();
      path=path + File.separatorChar + projectLabel+ File.separatorChar+ ERepositoryObjectType.getFolderName(ERepositoryObjectType.LIBS)+ File.separatorChar+ name;
      File libsTargetFile=new File(path);
      File source=new File(LibrariesManagerUtils.getLibrariesPath(ECodeLanguage.JAVA) + File.separatorChar + name);
      FilesUtils.copyFile(source,libsTargetFile);
      synJavaLibs(source);
    }
    eclipseProject.refreshLocal(IResource.DEPTH_INFINITE,new NullProgressMonitor());
  }
 catch (  IOException e) {
    CommonExceptionHandler.process(e);
  }
catch (  CoreException e) {
    CommonExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  IRepositoryService service=(IRepositoryService)GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
  service.getProxyRepositoryFactory().executeRepositoryWorkUnit(repositoryWorkUnit);
}
Program: 127184
Project: 127184
Buggy source:
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random(System.currentTimeMillis() + Thread.currentThread().getId() * 1000);
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}

Fixed version (ground truth):
/** 
 * getAsciiRandomString : Return a randomly generated String {talendTypes} String {Category} TalendString {param} int(6) length: length of the String to return {example} getAsciiRandomString(6) # Art34Z
 */
public static String getAsciiRandomString(int length){
  Random random=new Random();
  int cnt=0;
  StringBuffer buffer=new StringBuffer();
  char ch;
  int end='z' + 1;
  int start=' ';
  while (cnt < length) {
    ch=(char)(random.nextInt(end - start) + start);
    if (Character.isLetterOrDigit(ch)) {
      buffer.append(ch);
      cnt++;
    }
  }
  return buffer.toString();
}
Program: 127185
Project: 127185
Buggy source:
public String getProblemResource(){
  return this.type.getTypeName() + "String_Node_Str" + this.getName()+ "String_Node_Str"+ this.getLineNumber()+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getProblemResource(){
  return this.type.getTypeName() + "String_Node_Str" + this.getName()+ "String_Node_Str"+ this.getLineNumber()+ "String_Node_Str";
}
Program: 127186
Project: 127186
Buggy source:
public TalendProblem(ProblemStatus status,String javaUnitName,IMarker marker,String markerErrorMessage,Integer lineNumber,String uniName,Integer charStart,Integer charEnd,ProblemType type,String version){
  super();
  setDescription(markerErrorMessage);
  setStatus(status);
  List<IProcess2> openedProcessList=CorePlugin.getDefault().getDesignerCoreService().getOpenedProcess(getEditors());
  for (  IProcess2 process : openedProcessList) {
    if (javaUnitName != null && javaUnitName.equals(process.getName())) {
      BasicJobInfo jobInfo=new BasicJobInfo(process.getId(),null,process.getVersion());
      jobInfo.setJobName(process.getName());
      setJobInfo(jobInfo);
    }
  }
  this.javaUnitName=javaUnitName;
  this.marker=marker;
  this.lineNumber=lineNumber;
  this.unitName=uniName;
  this.charStart=charStart;
  this.charEnd=charEnd;
  this.version=version;
  setType(type);
  setNodeName(uniName);
}

Fixed version (ground truth):
public TalendProblem(ProblemStatus status,Item item,IMarker marker,String markerErrorMessage,Integer lineNumber,String uniName,Integer charStart,Integer charEnd,ProblemType type){
  super();
  setDescription(markerErrorMessage);
  setStatus(status);
  if (item.getProperty().getId() != null) {
    BasicJobInfo jobInfo=new BasicJobInfo(item.getProperty().getId(),null,item.getProperty().getVersion());
    jobInfo.setJobName(item.getProperty().getLabel());
    setJobInfo(jobInfo);
  }
  this.javaUnitName=item.getProperty().getLabel();
  this.marker=marker;
  this.lineNumber=lineNumber;
  this.unitName=uniName;
  this.charStart=charStart;
  this.charEnd=charEnd;
  this.version=item.getProperty().getVersion();
  setType(type);
  setNodeName(uniName);
}
Program: 127188
Project: 127188
Buggy source:
public boolean getEnabledState(){
  return super.getEnabledState() && this.enableStateHandler.getEnabledState();
}

Fixed version (ground truth):
@Override public boolean getEnabledState(){
  return super.getEnabledState() && this.enableStateHandler.getEnabledState();
}
Program: 127189
Project: 127189
Buggy source:
protected Command getCommandToExecute(){
  AbstractExtendedTableViewer extendedTableViewer=(AbstractExtendedTableViewer)extendedControlViewer;
  TableViewer tableViewer=extendedTableViewer.getTableViewerCreator().getTableViewer();
  ISelection selection=tableViewer.getSelection();
  StructuredSelection structuredSelection=(StructuredSelection)selection;
  Object[] objects=structuredSelection.toArray();
  return new ExtendedTableCopyCommand(Arrays.asList(objects));
}

Fixed version (ground truth):
@Override protected Command getCommandToExecute(){
  AbstractExtendedTableViewer extendedTableViewer=(AbstractExtendedTableViewer)extendedControlViewer;
  TableViewer tableViewer=extendedTableViewer.getTableViewerCreator().getTableViewer();
  ISelection selection=tableViewer.getSelection();
  StructuredSelection structuredSelection=(StructuredSelection)selection;
  Object[] objects=structuredSelection.toArray();
  colNum=getExtendedTableViewer().getTableViewerCreator().getTable().getColumnCount();
  return new ExtendedTableCopyCommand(Arrays.asList(objects));
}
Program: 127190
Project: 127190
Buggy source:
public boolean getEnabledState(){
  Object data=SimpleClipboard.getInstance().getData();
  return super.getEnabledState() && data != null && data instanceof List && !getExtendedControlViewer().isReadOnly();
}

Fixed version (ground truth):
@Override public boolean getEnabledState(){
  Object data=SimpleClipboard.getInstance().getData();
  boolean flag=true;
  int a=CopyPushButtonForExtendedTable.colNum;
  int colNum=getExtendedTableViewer().getTableViewerCreator().getTable().getColumnCount();
  if (data != null) {
    if (colNum == a) {
      flag=true;
    }
 else {
      flag=false;
    }
  }
  return super.getEnabledState() && data != null && data instanceof List && !getExtendedControlViewer().isReadOnly() && flag;
}
Program: 127192
Project: 127192
Buggy source:
/** 
 * called when the jar loadingin hook has failed to find the jar this is never called in a GUI thread.
 */
@Override public void update(Observable o,Object arg){
  if (arg != null && arg instanceof JarMissingEvent) {
    final JarMissingEvent jarMissingEvent=(JarMissingEvent)arg;
    if (!bundlesAlreadyHandled.contains(jarMissingEvent.getBundleId())) {
      bundlesAlreadyHandled.add(jarMissingEvent.getBundleId());
      showMissingModuleDialog(jarMissingEvent);
    }
  }
 else {
    IllegalArgumentException illegalArgumentException=new IllegalArgumentException("String_Node_Str" + JarMissingEvent.class.getCanonicalName());
    illegalArgumentException.fillInStackTrace();
    log.error("String_Node_Str",illegalArgumentException);
  }
}

Fixed version (ground truth):
/** 
 * called when the jar loadingin hook has failed to find the jar this is never called in a GUI thread.
 */
@Override public void update(Observable o,Object arg){
  if (arg != null && arg instanceof JarMissingEvent) {
    final JarMissingEvent jarMissingEvent=(JarMissingEvent)arg;
    if (!bundlesAlreadyHandled.contains(jarMissingEvent.getBundleId())) {
      bundlesAlreadyHandled.add(jarMissingEvent.getBundleId());
      Display.getDefault().asyncExec(new Runnable(){
        @Override public void run(){
          showMissingModuleDialog(jarMissingEvent);
        }
      }
);
    }
  }
 else {
    IllegalArgumentException illegalArgumentException=new IllegalArgumentException("String_Node_Str" + JarMissingEvent.class.getCanonicalName());
    illegalArgumentException.fillInStackTrace();
    log.error("String_Node_Str",illegalArgumentException);
  }
}
Program: 127193
Project: 127193
Buggy source:
@Override public void run(){
  ExternalModulesInstallDialogWithProgress dialog=new ExternalModulesInstallDialogWithProgress(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),SWT.APPLICATION_MODAL);
  dialog.showDialog(true,requiredJars.toArray(new String[requiredJars.size()]));
}

Fixed version (ground truth):
@Override public void run(){
  if (dialog == null) {
    dialog=new ExternalModulesInstallDialogWithProgress(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),SWT.APPLICATION_MODAL);
  }
  dialog.showDialog(true,requiredJars.toArray(new String[requiredJars.size()]));
}
Program: 127194
Project: 127194
Buggy source:
protected Command getCommandToExecute(){
  AbstractExtendedTableViewer extendedTableViewer=(AbstractExtendedTableViewer)extendedControlViewer;
  TableViewer tableViewer=extendedTableViewer.getTableViewerCreator().getTableViewer();
  ISelection selection=tableViewer.getSelection();
  StructuredSelection structuredSelection=(StructuredSelection)selection;
  Object[] objects=structuredSelection.toArray();
  return new ExtendedTableCopyCommand(Arrays.asList(objects));
}

Fixed version (ground truth):
protected Command getCommandToExecute(){
  AbstractExtendedTableViewer extendedTableViewer=(AbstractExtendedTableViewer)extendedControlViewer;
  TableViewer tableViewer=extendedTableViewer.getTableViewerCreator().getTableViewer();
  ISelection selection=tableViewer.getSelection();
  StructuredSelection structuredSelection=(StructuredSelection)selection;
  Object[] objects=structuredSelection.toArray();
  colNum=getExtendedTableViewer().getTableViewerCreator().getTable().getColumnCount();
  return new ExtendedTableCopyCommand(Arrays.asList(objects));
}
Program: 127195
Project: 127195
Buggy source:
public boolean getEnabledState(){
  Object data=SimpleClipboard.getInstance().getData();
  return super.getEnabledState() && data != null && data instanceof List && !getExtendedControlViewer().isReadOnly();
}

Fixed version (ground truth):
public boolean getEnabledState(){
  Object data=SimpleClipboard.getInstance().getData();
  boolean flag=true;
  int a=CopyPushButtonForExtendedTable.colNum;
  int colNum=getExtendedTableViewer().getTableViewerCreator().getTable().getColumnCount();
  if (data != null) {
    if (colNum == a) {
      flag=true;
    }
 else {
      flag=false;
    }
  }
  return super.getEnabledState() && data != null && data instanceof List && !getExtendedControlViewer().isReadOnly() && flag;
}
Program: 127197
Project: 127197
Buggy source:
public TalendProblem(ProblemStatus status,String javaUnitName,IMarker marker,String markerErrorMessage,Integer lineNumber,String uniName,Integer charStart,Integer charEnd,ProblemType type,String version){
  super();
  setDescription(markerErrorMessage);
  setStatus(status);
  List<IProcess2> openedProcessList=CorePlugin.getDefault().getDesignerCoreService().getOpenedProcess(getEditors());
  for (  IProcess2 process : openedProcessList) {
    if (javaUnitName != null && javaUnitName.equals(process.getName())) {
      BasicJobInfo jobInfo=new BasicJobInfo(process.getId(),null,process.getVersion());
      jobInfo.setJobName(process.getName());
      setJobInfo(jobInfo);
    }
  }
  this.javaUnitName=javaUnitName;
  this.marker=marker;
  this.lineNumber=lineNumber;
  this.unitName=uniName;
  this.charStart=charStart;
  this.charEnd=charEnd;
  this.version=version;
  setType(type);
  setNodeName(uniName);
}

Fixed version (ground truth):
public TalendProblem(ProblemStatus status,Item item,IMarker marker,String markerErrorMessage,Integer lineNumber,String uniName,Integer charStart,Integer charEnd,ProblemType type){
  super();
  setDescription(markerErrorMessage);
  setStatus(status);
  if (item.getProperty().getId() != null) {
    BasicJobInfo jobInfo=new BasicJobInfo(item.getProperty().getId(),null,item.getProperty().getVersion());
    jobInfo.setJobName(item.getProperty().getLabel());
    setJobInfo(jobInfo);
  }
  this.javaUnitName=item.getProperty().getLabel();
  this.marker=marker;
  this.lineNumber=lineNumber;
  this.unitName=uniName;
  this.charStart=charStart;
  this.charEnd=charEnd;
  this.version=item.getProperty().getVersion();
  setType(type);
  setNodeName(uniName);
}
Program: 127199
Project: 127199
Buggy source:
@Test public void testResultOK() throws TimeoutException, InterruptedException, ExecutionException {
  TimeoutTask<String> timoutTask=new TimeoutTask<String>(TEST_TASK);
  Callable<String> callable=new Callable<String>(){
    @Override public String call() throws Exception {
      Thread.sleep(10);
      return OK;
    }
  }
;
  Object result=timoutTask.run(callable,20,false);
  Assert.assertEquals(OK,result);
}

Fixed version (ground truth):
@Test public void testResultOK() throws TimeoutException, InterruptedException, ExecutionException {
  TimeoutTask<String> timoutTask=new TimeoutTask<String>(TEST_TASK);
  Callable<String> callable=new Callable<String>(){
    @Override public String call() throws Exception {
      Thread.sleep(10);
      return OK;
    }
  }
;
  FutureTask<String> futureTask=timoutTask.run(callable,20,false);
  Object result=futureTask.get();
  Assert.assertEquals(OK,result);
}
Program: 127200
Project: 127200
Buggy source:
/** 
 * ggu Comment method "checkContextMode". initialize and check context mode for the ConnectionItem.
 */
public static ContextItem checkContextMode(ConnectionItem connItem){
  if (connItem == null) {
    return null;
  }
  Connection connection=connItem.getConnection();
  if (connection == null) {
    return null;
  }
  String contextId=connection.getContextId();
  if (contextId == null || EMPTY.equals(contextId.trim()) || RepositoryNode.NO_ID.equals(contextId.trim())) {
    return null;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  try {
    IRepositoryViewObject context=factory.getLastVersion(contextId);
    if (context != null && factory.getStatus(context) != ERepositoryStatus.DELETED) {
      if (context.getProperty().getItem() instanceof ContextItem) {
        connection.setContextMode(true);
        return (ContextItem)context.getProperty().getItem();
      }
    }
  }
 catch (  PersistenceException e) {
  }
  connection.setContextMode(false);
  connection.setContextId(null);
  return null;
}

Fixed version (ground truth):
/** 
 * ggu Comment method "checkContextMode". initialize and check context mode for the ConnectionItem.
 */
public static ContextItem checkContextMode(ConnectionItem connItem){
  if (connItem == null) {
    return null;
  }
  Connection connection=connItem.getConnection();
  if (connection == null) {
    return null;
  }
  String contextId=connection.getContextId();
  if (contextId == null || EMPTY.equals(contextId.trim()) || RepositoryNode.NO_ID.equals(contextId.trim())) {
    connection.setContextMode(false);
    connection.setContextId(null);
    return null;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  try {
    IRepositoryViewObject context=factory.getLastVersion(contextId);
    if (context != null && factory.getStatus(context) != ERepositoryStatus.DELETED) {
      if (context.getProperty().getItem() instanceof ContextItem) {
        connection.setContextMode(true);
        return (ContextItem)context.getProperty().getItem();
      }
    }
  }
 catch (  PersistenceException e) {
  }
  connection.setContextMode(false);
  connection.setContextId(null);
  return null;
}
Program: 127201
Project: 127201
Buggy source:
/** 
 * ggu Comment method "checkContextMode". initialize and check context mode for the ConnectionItem.
 */
public static ContextItem checkContextMode(ConnectionItem connItem){
  if (connItem == null) {
    return null;
  }
  Connection connection=connItem.getConnection();
  if (connection == null) {
    return null;
  }
  String contextId=connection.getContextId();
  if (contextId == null || EMPTY.equals(contextId.trim()) || RepositoryNode.NO_ID.equals(contextId.trim())) {
    return null;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  try {
    IRepositoryViewObject context=factory.getLastVersion(contextId);
    if (context != null && factory.getStatus(context) != ERepositoryStatus.DELETED) {
      if (context.getProperty().getItem() instanceof ContextItem) {
        connection.setContextMode(true);
        return (ContextItem)context.getProperty().getItem();
      }
    }
  }
 catch (  PersistenceException e) {
  }
  connection.setContextMode(false);
  connection.setContextId(null);
  return null;
}

Fixed version (ground truth):
/** 
 * ggu Comment method "checkContextMode". initialize and check context mode for the ConnectionItem.
 */
public static ContextItem checkContextMode(ConnectionItem connItem){
  if (connItem == null) {
    return null;
  }
  Connection connection=connItem.getConnection();
  if (connection == null) {
    return null;
  }
  String contextId=connection.getContextId();
  if (contextId == null || EMPTY.equals(contextId.trim()) || RepositoryNode.NO_ID.equals(contextId.trim())) {
    connection.setContextMode(false);
    connection.setContextId(null);
    return null;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  try {
    IRepositoryViewObject context=factory.getLastVersion(contextId);
    if (context != null && factory.getStatus(context) != ERepositoryStatus.DELETED) {
      if (context.getProperty().getItem() instanceof ContextItem) {
        connection.setContextMode(true);
        return (ContextItem)context.getProperty().getItem();
      }
    }
  }
 catch (  PersistenceException e) {
  }
  connection.setContextMode(false);
  connection.setContextId(null);
  return null;
}
Program: 127202
Project: 127202
Buggy source:
@Override public void run(){
  MessageDialog.openError(Display.getDefault().getActiveShell(),"String_Node_Str",Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void run(){
}
Program: 127203
Project: 127203
Buggy source:
/** 
 * When database connection is renamed, refresh the connection label in the component view of job.
 * @param item
 */
public void refreshComponentView(Item item);

Fixed version (ground truth):
public void refreshComponentView();
Program: 127204
Project: 127204
Buggy source:
@Override public void run(){
  String message="String_Node_Str";
  if (!job.getInstalledModule().isEmpty()) {
    message=Messages.getString("String_Node_Str",data.getName());
    emptyLibs();
  }
 else {
    message=Messages.getString("String_Node_Str",data.getName());
    ;
  }
  MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),message);
}

Fixed version (ground truth):
@Override public void run(){
  String message="String_Node_Str";
  if (!job.getInstalledModule().isEmpty()) {
    message=Messages.getString("String_Node_Str",data.getName());
    emptyLibs();
  }
 else {
    message=Messages.getString("String_Node_Str",data.getName());
    ;
  }
  MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),message);
  if (enabledButtonCount.get() == 0) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
      IDesignerCoreService service=(IDesignerCoreService)GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
      if (service != null) {
        service.refreshComponentView();
      }
    }
  }
}
Program: 127206
Project: 127206
Buggy source:
@Override public void done(IJobChangeEvent event){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      String message="String_Node_Str";
      if (!job.getInstalledModule().isEmpty()) {
        message=Messages.getString("String_Node_Str",data.getName());
        emptyLibs();
      }
 else {
        message=Messages.getString("String_Node_Str",data.getName());
        ;
      }
      MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),message);
    }
  }
);
}

Fixed version (ground truth):
@Override public void done(IJobChangeEvent event){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      String message="String_Node_Str";
      if (!job.getInstalledModule().isEmpty()) {
        message=Messages.getString("String_Node_Str",data.getName());
        emptyLibs();
      }
 else {
        message=Messages.getString("String_Node_Str",data.getName());
        ;
      }
      MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),message);
      if (enabledButtonCount.get() == 0) {
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
          IDesignerCoreService service=(IDesignerCoreService)GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
          if (service != null) {
            service.refreshComponentView();
          }
        }
      }
    }
  }
);
}
Program: 127207
Project: 127207
Buggy source:
/** 
 * ggu Comment method "checkContextMode". initialize and check context mode for the ConnectionItem.
 */
public static ContextItem checkContextMode(ConnectionItem connItem){
  if (connItem == null) {
    return null;
  }
  Connection connection=connItem.getConnection();
  if (connection == null) {
    return null;
  }
  String contextId=connection.getContextId();
  if (contextId == null || EMPTY.equals(contextId.trim()) || RepositoryNode.NO_ID.equals(contextId.trim())) {
    return null;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  try {
    IRepositoryViewObject context=factory.getLastVersion(contextId);
    if (context != null && factory.getStatus(context) != ERepositoryStatus.DELETED) {
      if (context.getProperty().getItem() instanceof ContextItem) {
        connection.setContextMode(true);
        return (ContextItem)context.getProperty().getItem();
      }
    }
  }
 catch (  PersistenceException e) {
  }
  connection.setContextMode(false);
  connection.setContextId(null);
  return null;
}

Fixed version (ground truth):
/** 
 * ggu Comment method "checkContextMode". initialize and check context mode for the ConnectionItem.
 */
public static ContextItem checkContextMode(ConnectionItem connItem){
  if (connItem == null) {
    return null;
  }
  Connection connection=connItem.getConnection();
  if (connection == null) {
    return null;
  }
  String contextId=connection.getContextId();
  if (contextId == null || EMPTY.equals(contextId.trim()) || RepositoryNode.NO_ID.equals(contextId.trim())) {
    connection.setContextMode(false);
    connection.setContextId(null);
    return null;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  try {
    IRepositoryViewObject context=factory.getLastVersion(contextId);
    if (context != null && factory.getStatus(context) != ERepositoryStatus.DELETED) {
      if (context.getProperty().getItem() instanceof ContextItem) {
        connection.setContextMode(true);
        return (ContextItem)context.getProperty().getItem();
      }
    }
  }
 catch (  PersistenceException e) {
  }
  connection.setContextMode(false);
  connection.setContextId(null);
  return null;
}
Program: 127208
Project: 127208
Buggy source:
private String cutStr(String str,int len){
  String s="String_Node_Str";
  if (str.length() < len) {
    s+=str;
  }
  for (int i=0; i < str.length(); i++) {
    int r=i % len;
    if (i != 0 && i <= len) {
      if (r == 0) {
        s+=str.substring(i - len,len) + "String_Node_Str";
      }
    }
 else     if (i > len) {
      String laststr=str.substring(i - 1);
      if (laststr.length() > len) {
        s+=cutStr(laststr,len);
      }
 else {
        s+=laststr;
      }
      break;
    }
  }
  return s;
}

Fixed version (ground truth):
private String cutStr(String str,int len){
  String s="String_Node_Str";
  if (str == null || "String_Node_Str".equals(str)) {
    return null;
  }
  if (str.length() < len) {
    s+=str;
  }
  for (int i=0; i < str.length(); i++) {
    int r=i % len;
    if (i != 0 && i <= len) {
      if (r == 0) {
        s+=str.substring(i - len,len) + "String_Node_Str";
      }
    }
 else     if (i > len) {
      String laststr=str.substring(i - 1);
      if (laststr.length() > len) {
        s+=cutStr(laststr,len);
      }
 else {
        s+=laststr;
      }
      break;
    }
  }
  return s;
}
Program: 127209
Project: 127209
Buggy source:
public void init(){
  keyListener=new Listener(){
    public void handleEvent(    Event event){
      Widget widget=event.widget;
      if (widget instanceof Control) {
        Control control=(Control)widget;
        if (refControlIsShell && control.getShell() == refComposite || !refControlIsShell && refControlIsParentOf(control)) {
          keyPressedExecute(event);
        }
      }
    }
  }
;
  this.refComposite.getDisplay().addFilter(SWT.KeyDown,keyListener);
}

Fixed version (ground truth):
public void init(){
  keyListener=new Listener(){
    public void handleEvent(    Event event){
      Widget widget=event.widget;
      if (widget instanceof Control) {
        Control control=(Control)widget;
        if (refControlIsShell && control.getShell() == refComposite || !refControlIsShell && refControlIsParentOf(control)) {
          keyPressedExecute(event);
        }
      }
    }
  }
;
  this.refComposite.getDisplay().addFilter(SWT.KeyDown,keyListener);
  this.refComposite.addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      CommandStackForComposite.this.refComposite.getDisplay().removeFilter(SWT.KeyDown,keyListener);
      keyListener=null;
    }
  }
);
}
Program: 127210
Project: 127210
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
    Object property=node.getProperties(EProperties.CONTENT_TYPE);
switch (node.getType()) {
case REPOSITORY_ELEMENT:
case STABLE_SYSTEM_FOLDER:
      canWork=false;
    break;
case SYSTEM_FOLDER:
  if (ERepositoryObjectType.GENERATED.equals(property) || ERepositoryObjectType.JOBS.equals(property) || ERepositoryObjectType.JOBLETS.equals(property)|| ERepositoryObjectType.SQLPATTERNS.equals(property)|| ERepositoryObjectType.REFERENCED_PROJECTS.equals(property)|| ERepositoryObjectType.SVN_ROOT.equals(property)) {
    canWork=false;
  }
break;
case SIMPLE_FOLDER:
if (ERepositoryObjectType.JOB_DOC.equals(property) || ERepositoryObjectType.JOBLET_DOC.equals(property) || (ERepositoryObjectType.SQLPATTERNS.equals(property) && !isUnderUserDefined(node))) {
canWork=false;
}
if (node.getObject().getProperty().getItem().getState().isDeleted()) {
canWork=false;
}
break;
default :
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
    Object property=node.getProperties(EProperties.CONTENT_TYPE);
switch (node.getType()) {
case REPOSITORY_ELEMENT:
case STABLE_SYSTEM_FOLDER:
      canWork=false;
    break;
case SYSTEM_FOLDER:
  if (ERepositoryObjectType.GENERATED.equals(property) || ERepositoryObjectType.JOBS.equals(property) || ERepositoryObjectType.JOBLETS.equals(property)|| ERepositoryObjectType.SQLPATTERNS.equals(property)|| ERepositoryObjectType.REFERENCED_PROJECTS.equals(property)|| ERepositoryObjectType.SVN_ROOT.equals(property)) {
    canWork=false;
  }
break;
case SIMPLE_FOLDER:
if (ERepositoryObjectType.JOB_DOC.equals(property) || ERepositoryObjectType.JOBLET_DOC.equals(property) || (ERepositoryObjectType.SQLPATTERNS.equals(property) && !isUnderUserDefined(node))) {
canWork=false;
}
if (node.getObject().isDeleted()) {
canWork=false;
}
break;
default :
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}
Program: 127213
Project: 127213
Buggy source:
/** 
 * cli Comment method "clearRecords". revert the original values.
 */
public void clearRecords(){
  List list=getOpenedProcessList();
  if (list != null) {
    list.clear();
  }
  list=getProcessList();
  if (list != null) {
    list.clear();
  }
  MultiKeyMap map=getOpenProcessMap();
  if (map != null) {
    map.clear();
  }
  map=getRepositoryObjectMap();
  if (map != null) {
    map.clear();
  }
}

Fixed version (ground truth):
/** 
 * cli Comment method "clearRecords". revert the original values.
 */
public void clearRecords(){
  List<IProcess2> list=getOpenedProcessList();
  if (list != null) {
    list.clear();
  }
  List<IRepositoryViewObject> listobj=getProcessList();
  if (listobj != null) {
    listobj.clear();
  }
  MultiKeyMap map=getOpenProcessMap();
  if (map != null) {
    map.clear();
  }
  map=getRepositoryObjectMap();
  if (map != null) {
    map.clear();
  }
}
Program: 127215
Project: 127215
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
    Object obj=getLabelOfNode(node);
switch (node.getType()) {
case SIMPLE_FOLDER:
      String label=null;
    if (obj instanceof String) {
      label=(String)obj;
    }
  if (node.getContentType() == ERepositoryObjectType.JOB_DOC || node.getContentType() == ERepositoryObjectType.JOBLET_DOC || (node.getContentType() == ERepositoryObjectType.SQLPATTERNS && !isUnderUserDefined(node)) || RepositoryConstants.USER_DEFINED.equals(label)) {
    canWork=false;
  }
if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
  canWork=false;
}
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=!selection.isEmpty() && selection.size() == 1;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  if (canWork) {
    Object o=selection.getFirstElement();
    RepositoryNode node=(RepositoryNode)o;
    Object obj=getLabelOfNode(node);
switch (node.getType()) {
case SIMPLE_FOLDER:
      String label=null;
    if (obj instanceof String) {
      label=(String)obj;
    }
  if (node.getContentType() == ERepositoryObjectType.JOB_DOC || node.getContentType() == ERepositoryObjectType.JOBLET_DOC || (node.getContentType() == ERepositoryObjectType.SQLPATTERNS && !isUnderUserDefined(node)) || RepositoryConstants.USER_DEFINED.equals(label)) {
    canWork=false;
  }
if (node.getObject() != null && node.getObject().isDeleted()) {
  canWork=false;
}
break;
default :
canWork=false;
}
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
canWork=false;
}
}
setEnabled(canWork);
}
Program: 127216
Project: 127216
Buggy source:
@Override public List<IRepositoryViewObject> getChildren(){
  List<IRepositoryViewObject> toReturn=new ArrayList<IRepositoryViewObject>();
  FolderItem folderItem=(FolderItem)getProperty().getItem();
  for (  Object current : folderItem.getChildren()) {
    IRepositoryObject currentChild=new Folder(((FolderItem)current).getProperty(),getContentType());
    toReturn.add(currentChild);
  }
  return toReturn;
}

Fixed version (ground truth):
@Override public List<IRepositoryViewObject> getChildren(){
  List<IRepositoryViewObject> toReturn=new ArrayList<IRepositoryViewObject>();
  return toReturn;
}
Program: 127217
Project: 127217
Buggy source:
/** 
 * Returns the type.
 * @return ERepositoryObjectType.FOLDER
 */
public ERepositoryObjectType getRepositoryObjectType(){
  return ERepositoryObjectType.FOLDER;
}

Fixed version (ground truth):
/** 
 * Returns the type.
 * @return ERepositoryObjectType.FOLDER
 */
@Override public ERepositoryObjectType getRepositoryObjectType(){
  return ERepositoryObjectType.FOLDER;
}
Program: 127218
Project: 127218
Buggy source:
public Folder(Property property,ERepositoryObjectType type){
  super(property);
  this.type=type;
}

Fixed version (ground truth):
public Folder(Property property,ERepositoryObjectType type){
  super(property.getId(),property.getLabel());
  FolderItem folderItem=PropertiesFactory.eINSTANCE.createFolderItem();
  folderItem.setProperty(super.getProperty());
  super.getProperty().setItem(folderItem);
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  folderItem.setState(itemState);
  itemState.setDeleted(property.getItem().getState().isDeleted());
  path=property.getItem().getState().getPath();
  itemState.setPath(path);
  org.talend.core.model.properties.Project emfproject=ProjectManager.getInstance().getProject(property.getItem());
  this.projectLabel=emfproject.getLabel();
  this.type=type;
}
Program: 127219
Project: 127219
Buggy source:
@Override public boolean isDeleted(){
  return property.getItem().getState().isDeleted();
}

Fixed version (ground truth):
@Override public boolean isDeleted(){
  return getProperty().getItem().getState().isDeleted();
}
Program: 127220
Project: 127220
Buggy source:
@Override public String getPath(){
  return property.getItem().getState().getPath();
}

Fixed version (ground truth):
@Override public String getPath(){
  return getProperty().getItem().getState().getPath();
}
Program: 127221
Project: 127221
Buggy source:
/** 
 * Clear the data in this viewer.
 * @param jobContextManager2
 */
public void clear(){
  viewer.setInput(Collections.EMPTY_LIST);
}

Fixed version (ground truth):
/** 
 * Clear the data in this viewer.
 * @param jobContextManager2
 */
public void clear(){
  viewer.setInput(Collections.EMPTY_LIST);
  helper.initHelper(null);
}
Program: 127222
Project: 127222
Buggy source:
@Override protected void setTableViewerCreatorOptions(TableViewerCreator<IMetadataColumn> newTableViewerCreator){
  super.setTableViewerCreatorOptions(newTableViewerCreator);
}

Fixed version (ground truth):
@Override protected void setTableViewerCreatorOptions(TableViewerCreator<IMetadataColumn> newTableViewerCreator){
  super.setTableViewerCreatorOptions(newTableViewerCreator);
  newTableViewerCreator.setLazyLoad(true);
}
Program: 127223
Project: 127223
Buggy source:
@Override public boolean isPathValid(Project project,ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  if (path == null || type == null) {
    return false;
  }
  if (label.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
 else   if (RepositoryConstants.isSystemFolder(label) || RepositoryConstants.isGeneratedFolder(label) || RepositoryConstants.isJobsFolder(label)|| RepositoryConstants.isJobletsFolder(label)) {
    return false;
  }
 else {
    IProject fsProject=ResourceModelUtils.getProject(project);
    String completePath=null;
    if (type.equals(ERepositoryObjectType.TDQ_PATTERN_REGEX)) {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + label.toString();
    }
 else {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + path.toString();
      completePath=completePath + IPath.SEPARATOR + label;
    }
    IFolder existingFolder=ResourceUtils.getFolder(fsProject,completePath,false);
    return !existingFolder.exists();
  }
}

Fixed version (ground truth):
@Override public boolean isPathValid(Project project,ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  if (path == null || type == null) {
    return false;
  }
  if (label.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
 else   if (RepositoryConstants.isSystemFolder(label) || RepositoryConstants.isGeneratedFolder(label) || RepositoryConstants.isJobsFolder(label)|| RepositoryConstants.isJobletsFolder(label)) {
    return false;
  }
 else {
    IProject fsProject=ResourceModelUtils.getProject(project);
    String completePath=null;
    if (type.equals(ERepositoryObjectType.TDQ_PATTERN_REGEX)) {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + label.toString();
    }
 else {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + path.toString();
      completePath=completePath + IPath.SEPARATOR + label;
    }
    IFolder existingFolder=ResourceUtils.getFolder(fsProject,completePath,false);
    if (existingFolder.getLocation().toFile().exists()) {
      return false;
    }
    return !existingFolder.exists();
  }
}
Program: 127224
Project: 127224
Buggy source:
/** 
 * DOC ggu Comment method "isKeywords".
 * @param itemName
 * @return
 */
private boolean isKeywords(String itemName){
  if (property != null) {
    Item item=property.getItem();
    if (item instanceof ProcessItem || item instanceof JobletProcessItem || item instanceof RoutineItem) {
      return KeywordsValidator.isKeyword(itemName);
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC ggu Comment method "isKeywords".
 * @param itemName
 * @return
 */
protected boolean isKeywords(String itemName){
  if (property != null) {
    Item item=property.getItem();
    if (item instanceof ProcessItem || item instanceof JobletProcessItem || item instanceof RoutineItem) {
      return KeywordsValidator.isKeyword(itemName);
    }
  }
  return false;
}
Program: 127225
Project: 127225
Buggy source:
private Folder formdFolderTree(List<String> paths){
  Folder root=new Folder(Folder.ROOT_FOLDER);
  for (  String path : paths) {
    String[] splitedPaths=path.split("String_Node_Str");
    Folder lastFolder=null;
    for (int i=0; i < splitedPaths.length; i++) {
      String folderLabel=splitedPaths[i];
      if (i == 0) {
        lastFolder=new Folder(folderLabel);
        root.addChildFolder(lastFolder);
      }
 else {
        Folder newFolder=new Folder(folderLabel);
        lastFolder.addChildFolder(newFolder);
        lastFolder=newFolder;
      }
    }
  }
  return root;
}

Fixed version (ground truth):
private Folder formdFolderTree(List<String> paths){
  Folder root=new Folder(Folder.ROOT_FOLDER);
  for (  String path : paths) {
    String[] splitedPaths=path.split("String_Node_Str");
    Folder parentFolder=root;
    for (int i=0; i < splitedPaths.length; i++) {
      String parentLabel=root.getName();
      String folderLabel=splitedPaths[i];
      if (i > 0) {
        parentLabel=splitedPaths[i - 1];
        Folder findParent=findParentFolder(root,parentLabel,i);
        if (findParent != null) {
          parentFolder=findParent;
        }
      }
      boolean exist=false;
      for (      Folder children : parentFolder.getChildren()) {
        if (children.getName().equals(folderLabel)) {
          exist=true;
        }
      }
      if (!exist) {
        parentFolder.addChildFolder(new Folder(folderLabel));
      }
    }
  }
  return root;
}
Program: 127226
Project: 127226
Buggy source:
public Object[] getElements(Object inputElement){
  ERepositoryObjectType type=(ERepositoryObjectType)inputElement;
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    List<String> folders=factory.getFolders(type);
    List<String> fullPathList=new ArrayList<String>();
    List<String> finalFolders=new ArrayList<String>();
    for (int k=folders.size(); k > 0; k--) {
      fullPathList=getFullDirectoryPath(folders);
      finalFolders.add(fullPathList.get(0).trim());
      folders=getNewDirectoryPath(folders);
    }
    for (int i=0; i < finalFolders.size(); i++) {
      if (finalFolders.get(i).equals("String_Node_Str")) {
        finalFolders.remove(i);
        i--;
      }
    }
    Folder root=formdFolderTree(finalFolders);
    return new Folder[]{root};
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
    return new String[0];
  }
}

Fixed version (ground truth):
public Object[] getElements(Object inputElement){
  ERepositoryObjectType type=(ERepositoryObjectType)inputElement;
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    List<String> folders=factory.getFolders(type);
    Collections.sort(folders);
    Folder root=formdFolderTree(folders);
    return new Folder[]{root};
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
    return new String[0];
  }
}
Program: 127227
Project: 127227
Buggy source:
protected void evaluateTextField(){
  if (readOnly) {
    return;
  }
  if (nameText == null || nameText.isDisposed()) {
    return;
  }
  if (nameText.getText().length() == 0) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (!Pattern.matches(RepositoryConstants.getPattern(getRepositoryObjectType()),nameText.getText()) || nameText.getText().startsWith("String_Node_Str") || nameText.getText().trim().contains("String_Node_Str")) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (isKeywords(nameText.getText()) || "String_Node_Str".equalsIgnoreCase(nameText.getText())) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (nameModifiedByUser) {
    if (retrieveNameFinished) {
      if (!isValid(nameText.getText())) {
        nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
      }
 else {
        nameStatus=createOkStatus();
      }
    }
 else {
      nameStatus=createStatus(IStatus.ERROR,"String_Node_Str");
    }
  }
 else {
    nameStatus=createOkStatus();
  }
  if (property != null && nameStatus.getSeverity() == IStatus.OK) {
    property.setLabel(getPropertyLabel(StringUtils.trimToNull(nameText.getText())));
    property.setDisplayName(StringUtils.trimToNull(nameText.getText()));
    property.setModificationDate(new Date());
  }
  updatePageStatus();
}

Fixed version (ground truth):
protected void evaluateTextField(){
  if (readOnly) {
    return;
  }
  if (nameText == null || nameText.isDisposed()) {
    return;
  }
  if (nameText.getText().length() == 0) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (nameText.getText().startsWith("String_Node_Str") || !Pattern.matches(RepositoryConstants.getPattern(getRepositoryObjectType()),nameText.getText()) || nameText.getText().trim().contains("String_Node_Str")) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (isKeywords(nameText.getText()) || "String_Node_Str".equalsIgnoreCase(nameText.getText())) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (nameModifiedByUser) {
    if (retrieveNameFinished) {
      if (!isValid(nameText.getText())) {
        nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
      }
 else {
        nameStatus=createOkStatus();
      }
    }
 else {
      nameStatus=createStatus(IStatus.ERROR,"String_Node_Str");
    }
  }
 else {
    nameStatus=createOkStatus();
  }
  if (property != null && nameStatus.getSeverity() == IStatus.OK) {
    property.setLabel(getPropertyLabel(StringUtils.trimToNull(nameText.getText())));
    property.setDisplayName(StringUtils.trimToNull(nameText.getText()));
    property.setModificationDate(new Date());
  }
  updatePageStatus();
}
Program: 127228
Project: 127228
Buggy source:
private Folder formdFolderTree(List<String> paths){
  Folder root=new Folder(Folder.ROOT_FOLDER);
  String path=paths.get(paths.size() - 1);
  String[] splitedPaths=path.split("String_Node_Str");
  Folder lastFolder=null;
  for (int i=0; i < splitedPaths.length; i++) {
    String folderLabel=splitedPaths[i];
    if (i == 0) {
      lastFolder=new Folder(folderLabel);
      root.addChildFolder(lastFolder);
    }
 else {
      Folder newFolder=new Folder(folderLabel);
      lastFolder.addChildFolder(newFolder);
      lastFolder=newFolder;
    }
  }
  return root;
}

Fixed version (ground truth):
private Folder formdFolderTree(List<String> paths){
  Folder root=new Folder(Folder.ROOT_FOLDER);
  for (  String path : paths) {
    String[] splitedPaths=path.split("String_Node_Str");
    Folder lastFolder=null;
    for (int i=0; i < splitedPaths.length; i++) {
      String folderLabel=splitedPaths[i];
      if (i == 0) {
        lastFolder=new Folder(folderLabel);
        root.addChildFolder(lastFolder);
      }
 else {
        Folder newFolder=new Folder(folderLabel);
        lastFolder.addChildFolder(newFolder);
        lastFolder=newFolder;
      }
    }
  }
  return root;
}