nus-yam/ex-repair huggingface dataset:
Program: 141224
Project: 141224
Buggy source:
/** 
 * run Rnw script on Rserve server
 * @throws EoulsanException
 */
protected void runRserveRnwScript(final StepContext context) throws EoulsanException {
  try {
    LOGGER.info("String_Node_Str" + getRConnection().getServerName());
    Map<String,List<Sample>> experiments=experimentsSpliter();
    Set<String> cles=experiments.keySet();
    Iterator<String> itr=cles.iterator();
    while (itr.hasNext()) {
      String cle=itr.next();
      List<Sample> experimentSampleList=experiments.get(cle);
      LOGGER.info("String_Node_Str" + experimentSampleList.get(0).getMetadata().getExperiment());
      putExpressionFiles(experimentSampleList);
      String rScript=generateScript(experimentSampleList,context);
      runRnwScript(rScript,true);
      removeExpressionFiles(experimentSampleList);
      if (!context.getSettings().isSaveRscripts())       this.rConnection.removeFile(rScript);
      this.rConnection.getAllFiles(outPath.toString() + "String_Node_Str");
    }
  }
 catch (  REngineException e) {
    throw new EoulsanException("String_Node_Str" + e.getMessage());
  }
catch (  REXPMismatchException e) {
    throw new EoulsanException("String_Node_Str" + e.getMessage());
  }
 finally {
    try {
      this.rConnection.removeAllFiles();
      this.rConnection.disConnect();
    }
 catch (    Exception e) {
      throw new EoulsanException("String_Node_Str" + e.getMessage());
    }
  }
}

Fixed version (ground truth):
/** 
 * run Rnw script on Rserve server
 * @throws EoulsanException
 */
protected void runRserveRnwScript(final StepContext context) throws EoulsanException {
  try {
    LOGGER.info("String_Node_Str" + getRConnection().getServerName());
    Map<String,List<Sample>> experiments=experimentsSpliter();
    for (    List<Sample> experimentSampleList : experiments.values()) {
      LOGGER.info("String_Node_Str" + experimentSampleList.get(0).getMetadata().getExperiment());
      putExpressionFiles(experimentSampleList);
      String rScript=generateScript(experimentSampleList,context);
      runRnwScript(rScript,true);
      removeExpressionFiles(experimentSampleList);
      if (!context.getSettings().isSaveRscripts())       this.rConnection.removeFile(rScript);
      this.rConnection.getAllFiles(outPath.toString() + "String_Node_Str");
    }
  }
 catch (  REngineException e) {
    throw new EoulsanException("String_Node_Str" + e.getMessage());
  }
catch (  REXPMismatchException e) {
    throw new EoulsanException("String_Node_Str" + e.getMessage());
  }
 finally {
    try {
      this.rConnection.removeAllFiles();
      this.rConnection.disConnect();
    }
 catch (    Exception e) {
      throw new EoulsanException("String_Node_Str" + e.getMessage());
    }
  }
}
Program: 141225
Project: 141225
Buggy source:
/** 
 * run Rnw script on local mode
 * @throws EoulsanException
 */
protected void runLocalRnwScript(final StepContext context) throws EoulsanException {
  try {
    Map<String,List<Sample>> experiments=experimentsSpliter();
    Set<String> cles=experiments.keySet();
    Iterator<String> itr=cles.iterator();
    while (itr.hasNext()) {
      String cle=itr.next();
      List<Sample> experimentSampleList=experiments.get(cle);
      LOGGER.info("String_Node_Str" + experimentSampleList.get(0).getMetadata().getExperiment());
      String rScript=generateScript(experimentSampleList,context);
      runRnwScript(rScript,false);
      if (!context.getSettings().isSaveRscripts()) {
        new File(rScript).delete();
      }
    }
  }
 catch (  Exception e) {
    throw new EoulsanException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * run Rnw script on local mode
 * @throws EoulsanException
 */
protected void runLocalRnwScript(final StepContext context) throws EoulsanException {
  try {
    Map<String,List<Sample>> experiments=experimentsSpliter();
    for (    List<Sample> experimentSampleList : experiments.values()) {
      LOGGER.info("String_Node_Str" + experimentSampleList.get(0).getMetadata().getExperiment());
      String rScript=generateScript(experimentSampleList,context);
      runRnwScript(rScript,false);
      if (!context.getSettings().isSaveRscripts()) {
        new File(rScript).delete();
      }
    }
  }
 catch (  Exception e) {
    throw new EoulsanException("String_Node_Str" + e.getMessage());
  }
}
Program: 141226
Project: 141226
Buggy source:
/** 
 * 'key': annotation identifier of the feature (gene, mRNA, exon...). 'values': a list of '1', the size of this list is the number of reads found on the feature.
 */
@Override protected void reduce(final Text key,final Iterable<Text> values,final Context context) throws IOException, InterruptedException {
  int counts=0;
  for (  Text val : values) {
    counts++;
  }
  context.write(key,new Long(counts));
}

Fixed version (ground truth):
/** 
 * 'key': annotation identifier of the feature (gene, mRNA, exon...). 'values': a list of '1', the size of this list is the number of reads found on the feature.
 */
@Override protected void reduce(final Text key,final Iterable<Text> values,final Context context) throws IOException, InterruptedException {
  int counts=0;
  final Iterator<Text> it=values.iterator();
  while (it.hasNext()) {
    it.next();
    counts++;
  }
  context.write(key,Long.valueOf(counts));
}
Program: 141229
Project: 141229
Buggy source:
@Override public void configure(Set<Parameter> stepParameters) throws EoulsanException {
  for (  Parameter p : stepParameters) {
    if (FORMAT_PARAMETER.equals(p.getName()))     this.format=DataFormatRegistry.getInstance().getDataFormatFromName(p.getValue());
 else     if (OUTPUT_COMPRESSION_PARAMETER.equals(p.getName()))     this.outputCompression=CompressionType.valueOf(p.getValue());
  }
  if (this.format == null)   new EoulsanException("String_Node_Str");
  if (this.outputCompression == null)   new EoulsanException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void configure(Set<Parameter> stepParameters) throws EoulsanException {
  for (  Parameter p : stepParameters) {
    if (FORMAT_PARAMETER.equals(p.getName()))     this.format=DataFormatRegistry.getInstance().getDataFormatFromName(p.getValue());
 else     if (OUTPUT_COMPRESSION_PARAMETER.equals(p.getName()))     this.outputCompression=CompressionType.valueOf(p.getValue());
  }
  if (this.format == null)   throw new EoulsanException("String_Node_Str");
  if (this.outputCompression == null)   throw new EoulsanException("String_Node_Str");
}
Program: 141230
Project: 141230
Buggy source:
@Override public void configure(Set<Parameter> stepParameters) throws EoulsanException {
  for (  Parameter p : stepParameters) {
    if (FORMAT_PARAMETER.equals(p.getName())) {
      final DataFormatRegistry registry=DataFormatRegistry.getInstance();
      for (      String formatName : Splitter.on(',').split(p.getValue())) {
        final DataFormat format=registry.getDataFormatFromName(formatName);
        if (format != null)         this.formats.add(format);
      }
    }
  }
  if (this.formats.isEmpty())   new EoulsanException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void configure(Set<Parameter> stepParameters) throws EoulsanException {
  for (  Parameter p : stepParameters) {
    if (FORMAT_PARAMETER.equals(p.getName())) {
      final DataFormatRegistry registry=DataFormatRegistry.getInstance();
      for (      String formatName : Splitter.on(',').split(p.getValue())) {
        final DataFormat format=registry.getDataFormatFromName(formatName);
        if (format != null)         this.formats.add(format);
      }
    }
  }
  if (this.formats.isEmpty())   throw new EoulsanException("String_Node_Str");
}
Program: 141232
Project: 141232
Buggy source:
/** 
 * Sort several files in sortOutputFile
 * @return true if success sort
 * @throws IOException
 */
private boolean sort() throws IOException {
  this.sortOutputFile=File.createTempFile("String_Node_Str","String_Node_Str",this.tmpDir);
  String listFile="String_Node_Str";
  for (  File mapOutputFile : listMapOutputFile) {
    listFile+=StringUtils.bashEscaping(mapOutputFile.getAbsolutePath()) + "String_Node_Str";
  }
  final String cmd="String_Node_Str" + (this.tmpDir != null ? "String_Node_Str" + StringUtils.bashEscaping(this.tmpDir.getAbsolutePath()) : "String_Node_Str") + "String_Node_Str"+ StringUtils.bashEscaping(this.sortOutputFile.getAbsolutePath())+ "String_Node_Str"+ listFile;
  final boolean result=ProcessUtils.system(cmd) == 0;
  for (  File mapOutputFile : listMapOutputFile) {
    if (!mapOutputFile.delete())     LOGGER.warning("String_Node_Str" + mapOutputFile.getAbsolutePath());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Sort several files in sortOutputFile
 * @return true if success sort
 * @throws IOException
 */
private boolean sort() throws IOException {
  this.sortOutputFile=File.createTempFile("String_Node_Str","String_Node_Str",this.tmpDir);
  final StringBuilder listFile=new StringBuilder();
  for (  File mapOutputFile : listMapOutputFile) {
    listFile.append(StringUtils.bashEscaping(mapOutputFile.getAbsolutePath()));
    listFile.append("String_Node_Str");
  }
  final String cmd="String_Node_Str" + (this.tmpDir != null ? "String_Node_Str" + StringUtils.bashEscaping(this.tmpDir.getAbsolutePath()) : "String_Node_Str") + "String_Node_Str"+ StringUtils.bashEscaping(this.sortOutputFile.getAbsolutePath())+ "String_Node_Str"+ listFile.toString();
  final boolean result=ProcessUtils.system(cmd) == 0;
  for (  File mapOutputFile : listMapOutputFile) {
    if (!mapOutputFile.delete())     LOGGER.warning("String_Node_Str" + mapOutputFile.getAbsolutePath());
  }
  return result;
}
Program: 141233
Project: 141233
Buggy source:
/** 
 * Create a new DataFile object from the step, format, sample and file index.
 * @param step step of the file
 * @param format format of the file
 * @param sample sample of the file
 * @param fileIndex file index of the file for multifile data
 * @return a new DataFile object
 */
private static final DataFile newDataFile(final AbstractWorkflowStep step,final DataFormat format,final Sample sample,final int fileIndex){
  Preconditions.checkNotNull(format,"String_Node_Str");
  Preconditions.checkNotNull(sample,"String_Node_Str");
switch (step.getType()) {
case STANDARD_STEP:
case GENERATOR_STEP:
    if (!Arrays.asList(step.getStep().getOutputFormats()).contains(format))     throw new EoulsanRuntimeException("String_Node_Str" + format.getFormatName() + "String_Node_Str"+ step.getStep().getName());
  return newStandardDataFile(step.getContext(),step,format,sample,fileIndex);
case DESIGN_STEP:
final List<String> designValues=getDesignValues(step.getWorkflow().getDesign(),format,sample);
return newDesignDataFile(designValues,format,sample,fileIndex);
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Create a new DataFile object from the step, format, sample and file index.
 * @param step step of the file
 * @param format format of the file
 * @param sample sample of the file
 * @param fileIndex file index of the file for multifile data
 * @return a new DataFile object
 */
private static final DataFile newDataFile(final AbstractWorkflowStep step,final DataFormat format,final Sample sample,final int fileIndex){
  Preconditions.checkNotNull(format,"String_Node_Str");
  Preconditions.checkNotNull(sample,"String_Node_Str");
switch (step.getType()) {
case STANDARD_STEP:
case GENERATOR_STEP:
    if (!step.getStep().getOutputFormats().contains(format))     throw new EoulsanRuntimeException("String_Node_Str" + format.getFormatName() + "String_Node_Str"+ step.getStep().getName());
  return newStandardDataFile(step.getContext(),step,format,sample,fileIndex);
case DESIGN_STEP:
final List<String> designValues=getDesignValues(step.getWorkflow().getDesign(),format,sample);
return newDesignDataFile(designValues,format,sample,fileIndex);
default :
return null;
}
}
Program: 141234
Project: 141234
Buggy source:
@Override public Set<DataFormat> getInputFormats(){
  return Sets.newHashSet(MAPPER_RESULTS_SAM,GENOME_DESC_TXT);
}

Fixed version (ground truth):
@Override public Set<DataFormat> getInputFormats(){
  return newHashSet(MAPPER_RESULTS_SAM,GENOME_DESC_TXT);
}
Program: 141236
Project: 141236
Buggy source:
@Override public StepResult execute(final Design design,final Context context){
  if (getCounter().getCounterName().equals("String_Node_Str"))   return executeJobEoulsanCounter(design,context);
 else   if (getCounter().getCounterName().equals("String_Node_Str"))   return executeJobHTSeqCounter(design,context);
  return new StepResult(context,new EoulsanException("String_Node_Str" + getCounter().getCounterName()),"String_Node_Str" + getCounter().getCounterName());
}

Fixed version (ground truth):
@Override public StepResult execute(final Design design,final Context context){
  if (getCounter().getCounterName().equals(EoulsanCounter.COUNTER_NAME))   return executeJobEoulsanCounter(design,context);
 else   if (getCounter().getCounterName().equals(HTSeqCounter.COUNTER_NAME))   return executeJobHTSeqCounter(design,context);
  return new StepResult(context,new EoulsanException("String_Node_Str" + getCounter().getCounterName()),"String_Node_Str" + getCounter().getCounterName());
}
Program: 141237
Project: 141237
Buggy source:
private static final void createFinalExpressionFeaturesFile(final Context context,final Map<Sample,Job> jobconfs,final Configuration conf) throws IOException {
  FinalExpressionFeaturesCreator fefc=null;
  for (  Map.Entry<Sample,Job> e : jobconfs.entrySet()) {
    final Sample sample=e.getKey();
    final FileSystem fs=new Path(context.getBasePathname()).getFileSystem(conf);
    final Path featuresIndexPath=new Path(context.getOtherDataFilename(ANNOTATION_INDEX_SERIAL,sample));
    fefc=new FinalExpressionFeaturesCreator(fs.open(featuresIndexPath));
    final Path resultPath=new Path(context.getOtherDataFilename(EXPRESSION_RESULTS_TXT,sample));
    fefc.initializeExpressionResults();
    fefc.loadPreResults(new DataFile(context.getOutputDataFile(EXPRESSION_RESULTS_TXT,sample).getSourceWithoutExtension() + "String_Node_Str").open());
    fefc.saveFinalResults(fs.create(resultPath));
  }
}

Fixed version (ground truth):
private static final void createFinalExpressionFeaturesFile(final Context context,final Map<Sample,Job> jobconfs,final Configuration conf) throws IOException {
  FinalExpressionFeaturesCreator fefc=null;
  for (  Map.Entry<Sample,Job> e : jobconfs.entrySet()) {
    LOGGER.info("String_Node_Str" + e.getValue().getConfiguration().get("String_Node_Str"));
    Path p=new Path(e.getValue().getConfiguration().get("String_Node_Str"));
    FileSystem fs=FileSystem.get(p.toUri(),conf);
    for (    FileStatus fst : fs.listStatus(p.getParent())) {
      LOGGER.info(fst.getPath().getName() + "String_Node_Str" + fst.getLen());
    }
    final Sample sample=e.getKey();
    final Path featuresIndexPath=new Path(context.getOtherDataFilename(ANNOTATION_INDEX_SERIAL,sample));
    fefc=new FinalExpressionFeaturesCreator(fs.open(featuresIndexPath));
    final Path resultPath=new Path(context.getOtherDataFilename(EXPRESSION_RESULTS_TXT,sample));
    fefc.initializeExpressionResults();
    fefc.loadPreResults(new DataFile(e.getValue().getConfiguration().get("String_Node_Str")).open());
    fefc.saveFinalResults(fs.create(resultPath));
  }
}
Program: 141238
Project: 141238
Buggy source:
public Ticket(final int pid,final long threadId,final long creationTime,final long nanoCreationTime,final long lastActiveTime,final boolean working){
  this.pid=pid;
  this.threadId=threadId;
  this.creationTime=creationTime;
  this.nanoCreationTime=nanoCreationTime;
  this.lastActiveTime=lastActiveTime == -1 ? this.creationTime : lastActiveTime;
  this.working=working;
}

Fixed version (ground truth):
public Ticket(final int pid,final long threadId,final long creationTime,final long nanoCreationTime,final String description,final long lastActiveTime,final boolean working){
  this.pid=pid;
  this.threadId=threadId;
  this.creationTime=creationTime;
  this.nanoCreationTime=nanoCreationTime;
  this.description=description;
  this.lastActiveTime=lastActiveTime == -1 ? this.creationTime : lastActiveTime;
  this.working=working;
}
Program: 141239
Project: 141239
Buggy source:
@Override public String toString(){
  return (this.creationTime - initTime) + "String_Node_Str" + this.pid+ '.'+ this.threadId+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return DATE_FORMAT.format(new Date(this.creationTime)) + "String_Node_Str" + DATE_FORMAT.format(new Date(this.lastActiveTime))+ "String_Node_Str"+ DATE_FORMAT.format(new Date(System.currentTimeMillis() - this.creationTime))+ "String_Node_Str"+ (this.working ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ this.pid+ '.'+ this.threadId+ "String_Node_Str"+ (this.description != null ? this.description : "String_Node_Str")+ "String_Node_Str";
}
Program: 141240
Project: 141240
Buggy source:
@Override public void lock() throws IOException {
  if (thread == null)   thread=new LockerThread(new Ticket());
  final Thread t=new Thread(thread);
  t.start();
  while (t.isAlive())   try {
    Thread.sleep(1000);
  }
 catch (  InterruptedException e) {
  }
}

Fixed version (ground truth):
@Override public void lock() throws IOException {
  if (thread == null)   thread=new LockerThread(new Ticket(this.description));
  final Thread t=new Thread(thread);
  t.start();
  while (t.isAlive())   try {
    Thread.sleep(1000);
  }
 catch (  InterruptedException e) {
  }
}
Program: 141241
Project: 141241
Buggy source:
/** 
 * Public constructor.
 * @param lockerName The name of the locker
 * @param port port to use
 */
public TicketLocker(final String lockerName,final int port){
  this.lockerName=lockerName;
  this.port=port;
}

Fixed version (ground truth):
/** 
 * Public constructor.
 * @param lockerName The name of the locker
 * @param port port to use
 * @param description locker description
 */
public TicketLocker(final String lockerName,final int port,final String description){
  this.lockerName=lockerName;
  this.port=port;
  this.description=description;
}
Program: 141242
Project: 141242
Buggy source:
/** 
 * Main method.
 * @param args command line arguments
 * @throws RemoteException if an error occurs while inspecting tickets
 */
public static final void main(String[] args) throws RemoteException {
  if (args.length < 2) {
    System.err.println("String_Node_Str" + TicketLocker.class.getName() + "String_Node_Str");
    return;
  }
  TicketLocker locker=new TicketLocker(args[0],Integer.parseInt(args[1]));
  for (  Ticket t : locker.getStub().getTickets(null)) {
    System.out.println(t);
  }
}

Fixed version (ground truth):
/** 
 * Main method.
 * @param args command line arguments
 * @throws RemoteException if an error occurs while inspecting tickets
 * @throws MalformedURLException
 */
public static final void main(String[] args) throws RemoteException, MalformedURLException {
  if (args.length < 2) {
    System.err.println("String_Node_Str" + TicketLocker.class.getName() + "String_Node_Str");
    return;
  }
  TicketLocker locker=new TicketLocker(args[0],Integer.parseInt(args[1]),null);
  List<Ticket> tickets=new ArrayList<Ticket>(locker.getStub().getTickets(null));
  Collections.sort(tickets);
  for (  Ticket t : tickets) {
    System.out.println(t);
  }
}
Program: 141243
Project: 141243
Buggy source:
public static void newServer(final Set<Ticket> tickets,final String lockerName,final int port){
  try {
    final TicketScheduler stub=(TicketScheduler)UnicastRemoteObject.exportObject(new TicketSchedulerServer(tickets),0);
    Registry registry=LocateRegistry.getRegistry(port);
    if (registry == null)     registry=LocateRegistry.createRegistry(port);
    registry.bind(TicketLocker.RMI_SERVICE_PREFIX + lockerName,stub);
  }
 catch (  Exception e) {
    Utils.nop();
  }
}

Fixed version (ground truth):
public static void newServer(final Set<Ticket> tickets,final String lockerName,final int port){
  if (serverInstance != null)   return;
  try {
    serverInstance=new TicketSchedulerServer(tickets);
    final TicketScheduler stub=(TicketScheduler)UnicastRemoteObject.exportObject(serverInstance,0);
    Registry registry=LocateRegistry.getRegistry(port);
    if (registry == null)     registry=LocateRegistry.createRegistry(port);
    registry.bind(TicketLocker.RMI_SERVICE_PREFIX + lockerName,stub);
  }
 catch (  Exception e) {
    Utils.nop();
  }
}
Program: 141244
Project: 141244
Buggy source:
public TicketSchedulerServer(final Set<Ticket> tickets){
  if (tickets != null) {
    for (    Ticket t : tickets)     this.tickets.put(t,t);
    check();
  }
}

Fixed version (ground truth):
private TicketSchedulerServer(final Set<Ticket> tickets){
  if (tickets != null) {
    for (    Ticket t : tickets)     this.tickets.put(t,t);
    check();
  }
}
Program: 141246
Project: 141246
Buggy source:
/** 
 * Execute the analysis.
 * @param rScript
 * @throws IOException
 * @throws REngineException
 * @throws EoulsanException
 */
private void runRnwScript(String rnwScript) throws REngineException, EoulsanException {
  if (EoulsanRuntime.getSettings().isRServeServerEnabled()) {
    this.rConnection.executeRnwCode(rnwScript);
  }
 else {
    try {
      final ProcessBuilder pb=new ProcessBuilder("String_Node_Str","String_Node_Str","String_Node_Str",StringUtils.bashEscaping(rnwScript));
      pb.environment().put("String_Node_Str",this.outPath.getAbsolutePath());
      ProcessUtils.logEndTime(pb.start(),pb.toString(),System.currentTimeMillis());
      if (!new File(rnwScript).delete())       LOGGER.warning("String_Node_Str" + rnwScript);
    }
 catch (    IOException e) {
      throw new EoulsanException("String_Node_Str" + e.getMessage());
    }
  }
}

Fixed version (ground truth):
/** 
 * Execute the analysis.
 * @param rScript
 * @throws IOException
 * @throws REngineException
 * @throws EoulsanException
 */
private void runRnwScript(String rnwScript) throws REngineException, EoulsanException {
  if (EoulsanRuntime.getSettings().isRServeServerEnabled()) {
    this.rConnection.executeRnwCode(rnwScript);
  }
 else {
    try {
      final ProcessBuilder pb=new ProcessBuilder("String_Node_Str","String_Node_Str","String_Node_Str",rnwScript);
      pb.environment().put("String_Node_Str",this.outPath.getAbsolutePath());
      ProcessUtils.logEndTime(pb.start(),Joiner.on(' ').join(pb.command()),System.currentTimeMillis());
      if (!new File(rnwScript).delete())       LOGGER.warning("String_Node_Str" + rnwScript);
    }
 catch (    IOException e) {
      throw new EoulsanException("String_Node_Str" + e.getMessage());
    }
  }
}
Program: 141248
Project: 141248
Buggy source:
@Override public boolean equals(final Object o){
  if (o == this)   return true;
  if (o == null || !(o instanceof Exon))   return false;
  final GenomicInterval that=(GenomicInterval)o;
  return Utils.equal(this.chromosome,that.chromosome) && this.start == that.start && this.end == that.end && this.strand == that.strand;
}

Fixed version (ground truth):
@Override public boolean equals(final Object o){
  if (o == this)   return true;
  if (o == null || !(o instanceof GenomicInterval))   return false;
  final GenomicInterval that=(GenomicInterval)o;
  return Utils.equal(this.chromosome,that.chromosome) && this.start == that.start && this.end == that.end && this.strand == that.strand;
}
Program: 141249
Project: 141249
Buggy source:
@Override protected void internalCount(File alignmentFile,DataFile annotationFile,File expressionFile,final DataFile genomeDescFile,Reporter reporter,String counterGroup) throws IOException {
  ExpressionPseudoMapReduce epmr=null;
  String lastAnnotationKey=null;
  final String genomicType=getGenomicType();
  final String annotationKey=annotationFile.getName() + "String_Node_Str" + getGenomicType();
  final File expressionTmpFile=new File(alignmentFile.getAbsolutePath() + "String_Node_Str");
  try {
    if (!annotationKey.equals(lastAnnotationKey)) {
      epmr=new ExpressionPseudoMapReduce(annotationFile.open(),genomicType,genomeDescFile.open(),counterGroup);
      lastAnnotationKey=annotationKey;
    }
    if (getTempDirectory() != null)     epmr.setMapReduceTemporaryDirectory(new File(getTempDirectory()));
    epmr.doMap(alignmentFile);
    epmr.doReduce(expressionTmpFile);
    final FinalExpressionTranscriptsCreator fetc=new FinalExpressionTranscriptsCreator(epmr.getTranscriptAndExonFinder());
    fetc.initializeExpressionResults();
    fetc.loadPreResults(expressionTmpFile,epmr.getReporter().getCounterValue(counterGroup,"String_Node_Str"));
    fetc.saveFinalResults(expressionFile);
    if (!expressionTmpFile.delete())     LOGGER.warning("String_Node_Str" + expressionTmpFile.getAbsolutePath());
  }
 catch (  BadBioEntryException e) {
  }
}

Fixed version (ground truth):
@Override protected void internalCount(final File alignmentFile,final DataFile annotationFile,final File expressionFile,final DataFile genomeDescFile,final Reporter reporter,final String counterGroup) throws IOException {
  ExpressionPseudoMapReduce epmr=null;
  final String genomicType=getGenomicType();
  final File expressionTmpFile=new File(alignmentFile.getAbsolutePath() + "String_Node_Str");
  try {
    epmr=new ExpressionPseudoMapReduce(annotationFile.open(),genomicType,genomeDescFile.open(),counterGroup);
    if (getTempDirectory() != null)     epmr.setMapReduceTemporaryDirectory(new File(getTempDirectory()));
    epmr.doMap(alignmentFile);
    epmr.doReduce(expressionTmpFile);
    final FinalExpressionTranscriptsCreator fetc=new FinalExpressionTranscriptsCreator(epmr.getTranscriptAndExonFinder());
    fetc.initializeExpressionResults();
    fetc.loadPreResults(expressionTmpFile,epmr.getReporter().getCounterValue(counterGroup,"String_Node_Str"));
    fetc.saveFinalResults(expressionFile);
    if (!expressionTmpFile.delete())     LOGGER.warning("String_Node_Str" + expressionTmpFile.getAbsolutePath());
  }
 catch (  BadBioEntryException e) {
  }
}
Program: 141250
Project: 141250
Buggy source:
/** 
 * Public constructor.
 * @param serverName RServe server to use
 */
public RSConnectionNewImpl(final String serverName){
  System.out.println(this.serverName);
  this.serverName=serverName == null ? "String_Node_Str" : serverName.trim();
}

Fixed version (ground truth):
/** 
 * Public constructor.
 * @param serverName RServe server to use
 */
public RSConnectionNewImpl(final String serverName){
  this.serverName=serverName == null ? "String_Node_Str" : serverName.trim();
}
Program: 141254
Project: 141254
Buggy source:
/** 
 * Get the value of the setting as a double value
 * @return the value of the setting as an double
 * @throws EoulsanException if the value is not an double
 */
public double getDoubleSetting(final String settingName) throws EoulsanException {
  if (settingName == null)   throw new EoulsanException("String_Node_Str");
  final String value=getSetting(settingName);
  if (value == null)   throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  try {
    return Double.parseDouble(value);
  }
 catch (  NumberFormatException e) {
    throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  }
}

Fixed version (ground truth):
/** 
 * Get the value of the setting as a double value
 * @return the value of the setting as an double
 * @throws EoulsanException if the value is not an double
 */
public double getDoubleSetting(final String settingName) throws EoulsanException {
  if (settingName == null)   throw new EoulsanException("String_Node_Str");
  final String value=getSetting(settingName);
  if (value == null)   throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str");
  try {
    return Double.parseDouble(value);
  }
 catch (  NumberFormatException e) {
    throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  }
}
Program: 141255
Project: 141255
Buggy source:
/** 
 * Get the value of the setting as a integer value
 * @return the value of the setting as an integer
 * @throws EoulsanException if the value is not an integer
 */
public int getIntSetting(final String settingName) throws EoulsanException {
  if (settingName == null)   throw new EoulsanException("String_Node_Str");
  final String value=getSetting(settingName);
  if (value == null)   throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  try {
    return Integer.parseInt(value);
  }
 catch (  NumberFormatException e) {
    throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  }
}

Fixed version (ground truth):
/** 
 * Get the value of the setting as a integer value
 * @return the value of the setting as an integer
 * @throws EoulsanException if the value is not an integer
 */
public int getIntSetting(final String settingName) throws EoulsanException {
  if (settingName == null)   throw new EoulsanException("String_Node_Str");
  final String value=getSetting(settingName);
  if (value == null)   throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str");
  try {
    return Integer.parseInt(value);
  }
 catch (  NumberFormatException e) {
    throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  }
}
Program: 141256
Project: 141256
Buggy source:
@Override public String getMapperVersion(){
  try {
    final String execPath;
synchronized (SYNC) {
      execPath=BinariesInstaller.install(MAPPER_EXECUTABLE,getTempDirectoryPath());
    }
    final String cmd=execPath;
    final String s=ProcessUtils.execToString(cmd,true,false);
    if (s == null)     return null;
    final String[] lines=s.split("String_Node_Str");
    for (int i=0; i < lines.length; i++)     if (lines[i].startsWith("String_Node_Str")) {
      final String[] tokens=lines[i].split("String_Node_Str");
      if (tokens.length > 1)       return tokens[1].trim();
    }
    return null;
  }
 catch (  IOException e) {
    return null;
  }
}

Fixed version (ground truth):
@Override public String getMapperVersion(){
  try {
    final String execPath;
synchronized (SYNC) {
      execPath=BinariesInstaller.install(MAPPER_EXECUTABLE,getTempDirectoryPath());
    }
    final String cmd=execPath;
    final String s=ProcessUtils.execToString(cmd,true,false);
    final String[] lines=s.split("String_Node_Str");
    for (int i=0; i < lines.length; i++)     if (lines[i].startsWith("String_Node_Str")) {
      final String[] tokens=lines[i].split("String_Node_Str");
      if (tokens.length > 1)       return tokens[1].trim();
    }
    return null;
  }
 catch (  IOException e) {
    return null;
  }
}
Program: 141257
Project: 141257
Buggy source:
@Override public String getMapperVersion(){
  try {
    final String bowtiePath;
synchronized (SYNC) {
      bowtiePath=install(MAPPER_EXECUTABLE);
    }
    final String cmd=bowtiePath + "String_Node_Str";
    final String s=ProcessUtils.execToString(cmd);
    if (s == null)     return null;
    final String[] lines=s.split("String_Node_Str");
    if (lines.length == 0)     return null;
    final String[] tokens=lines[0].split("String_Node_Str");
    if (tokens.length > 1)     return tokens[1].trim();
    return null;
  }
 catch (  IOException e) {
    return null;
  }
}

Fixed version (ground truth):
@Override public String getMapperVersion(){
  try {
    final String bowtiePath;
synchronized (SYNC) {
      bowtiePath=install(MAPPER_EXECUTABLE);
    }
    final String cmd=bowtiePath + "String_Node_Str";
    final String s=ProcessUtils.execToString(cmd);
    final String[] lines=s.split("String_Node_Str");
    if (lines.length == 0)     return null;
    final String[] tokens=lines[0].split("String_Node_Str");
    if (tokens.length > 1)     return tokens[1].trim();
    return null;
  }
 catch (  IOException e) {
    return null;
  }
}
Program: 141258
Project: 141258
Buggy source:
@Override public String getMapperVersion(){
  try {
    final String gmapPath;
synchronized (SYNC) {
      gmapPath=install(MAPPER_EXECUTABLE);
    }
    final String cmd=gmapPath + "String_Node_Str";
    final String s=ProcessUtils.execToString(cmd);
    if (s == null)     return null;
    final String[] lines=s.split("String_Node_Str");
    if (lines.length == 0)     return null;
    final String[] tokens1=lines[0].split("String_Node_Str");
    if (tokens1.length > 1) {
      final String[] tokens2=tokens1[1].trim().split("String_Node_Str");
      if (tokens2.length > 1)       return tokens2[0];
    }
    return null;
  }
 catch (  IOException e) {
    return null;
  }
}

Fixed version (ground truth):
@Override public String getMapperVersion(){
  try {
    final String gmapPath;
synchronized (SYNC) {
      gmapPath=install(MAPPER_EXECUTABLE);
    }
    final String cmd=gmapPath + "String_Node_Str";
    final String s=ProcessUtils.execToString(cmd);
    final String[] lines=s.split("String_Node_Str");
    if (lines.length == 0)     return null;
    final String[] tokens1=lines[0].split("String_Node_Str");
    if (tokens1.length > 1) {
      final String[] tokens2=tokens1[1].trim().split("String_Node_Str");
      if (tokens2.length > 1)       return tokens2[0];
    }
    return null;
  }
 catch (  IOException e) {
    return null;
  }
}
Program: 141259
Project: 141259
Buggy source:
@Override public String getMapperVersion(){
  try {
    final String execPath;
synchronized (SYNC) {
      execPath=install(MAPPER_EXECUTABLE);
    }
    final String cmd=execPath;
    final String s=ProcessUtils.execToString(cmd,true,false);
    if (s == null)     return null;
    final String[] lines=s.split("String_Node_Str");
    for (int i=0; i < lines.length; i++)     if (lines[i].startsWith("String_Node_Str")) {
      final String[] tokens=lines[i].split("String_Node_Str");
      if (tokens.length > 1)       return tokens[1].trim();
    }
    return null;
  }
 catch (  IOException e) {
    return null;
  }
}

Fixed version (ground truth):
@Override public String getMapperVersion(){
  try {
    final String execPath;
synchronized (SYNC) {
      execPath=install(MAPPER_EXECUTABLE);
    }
    final String cmd=execPath;
    final String s=ProcessUtils.execToString(cmd,true,false);
    final String[] lines=s.split("String_Node_Str");
    for (int i=0; i < lines.length; i++)     if (lines[i].startsWith("String_Node_Str")) {
      final String[] tokens=lines[i].split("String_Node_Str");
      if (tokens.length > 1)       return tokens[1].trim();
    }
    return null;
  }
 catch (  IOException e) {
    return null;
  }
}
Program: 141260
Project: 141260
Buggy source:
@Override public boolean exists(final DataFile src){
  try {
    final DataFile f=internalDataFile(src);
    if (f == null)     return false;
    return f.exists();
  }
 catch (  IOException e) {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean exists(final DataFile src){
  try {
    return internalDataFile(src).exists();
  }
 catch (  IOException e) {
    return false;
  }
}
Program: 141261
Project: 141261
Buggy source:
/** 
 * Custom splitter for Casava tabulated file.
 * @param line line to parse
 * @return a list of String with the contents of each cell without unnecessaryquotes
 */
public static List<String> parseTabulatedDesignLine(final String s){
  if (s == null)   return null;
  final String[] fields=s.split("String_Node_Str");
  if (fields == null)   return null;
  return Arrays.asList(fields);
}

Fixed version (ground truth):
/** 
 * Custom splitter for Casava tabulated file.
 * @param line line to parse
 * @return a list of String with the contents of each cell without unnecessaryquotes
 */
public static List<String> parseTabulatedDesignLine(final String s){
  if (s == null)   return null;
  return Arrays.asList(s.split("String_Node_Str"));
}
Program: 141262
Project: 141262
Buggy source:
/** 
 * Get the list of DataFormat of the files to download
 * @param context current context
 * @return a list with the DataFormat of the files to download
 */
private List<DataFormat> getDataFormats(final Context context){
  final List<DataFormat> result=Lists.newArrayList();
  final String list=context.getRuntime().getSettings().getSetting(DATAFORMATS_TO_DOWNLOAD_SETTING);
  if (list == null) {
    return result;
  }
  final String[] fields=list.split("String_Node_Str");
  if (fields == null) {
    return result;
  }
  final DataFormatRegistry registry=DataFormatRegistry.getInstance();
  for (  String dataFormatName : fields) {
    final DataFormat df=registry.getDataFormatFromName(dataFormatName);
    if (df != null) {
      result.add(df);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Get the list of DataFormat of the files to download
 * @param context current context
 * @return a list with the DataFormat of the files to download
 */
private List<DataFormat> getDataFormats(final Context context){
  final List<DataFormat> result=Lists.newArrayList();
  final String list=context.getRuntime().getSettings().getSetting(DATAFORMATS_TO_DOWNLOAD_SETTING);
  if (list == null) {
    return result;
  }
  final String[] fields=list.split("String_Node_Str");
  final DataFormatRegistry registry=DataFormatRegistry.getInstance();
  for (  String dataFormatName : fields) {
    final DataFormat df=registry.getDataFormatFromName(dataFormatName);
    if (df != null) {
      result.add(df);
    }
  }
  return result;
}
Program: 141263
Project: 141263
Buggy source:
/** 
 * Utility method to create fast BufferedReader.
 * @param is InputStream to read
 * @param charset Charset to use
 * @return a BufferedReader
 */
public static final BufferedReader createBufferedReader(final InputStream is,final Charset charset){
  if (is == null)   throw new NullPointerException("String_Node_Str");
  if (charset != null)   return new BufferedReader(new InputStreamReader(is,charset));
  return new BufferedReader(new InputStreamReader(is,charset != null ? charset : Charset.forName(CHARSET)));
}

Fixed version (ground truth):
/** 
 * Utility method to create fast BufferedReader.
 * @param is InputStream to read
 * @param charset Charset to use
 * @return a BufferedReader
 */
public static final BufferedReader createBufferedReader(final InputStream is,final Charset charset){
  if (is == null)   throw new NullPointerException("String_Node_Str");
  if (charset != null)   return new BufferedReader(new InputStreamReader(is,charset));
  return new BufferedReader(new InputStreamReader(is,Charset.forName(CHARSET)));
}
Program: 141264
Project: 141264
Buggy source:
/** 
 * Execute a command with the OS and return the output in a string.
 * @param cmd Command to execute
 * @param addStdErr add the output of stderr in the result
 * @return a string with the output the command
 * @throws IOException if an error occurs while running the process
 */
public static String execToString(final String cmd,final boolean addStdErr,final boolean checkExitCode) throws IOException {
  logger.fine("String_Node_Str" + Thread.currentThread().getId() + "String_Node_Str"+ cmd);
  final long startTime=System.currentTimeMillis();
  Process p=Runtime.getRuntime().exec(new String[]{"String_Node_Str","String_Node_Str",cmd});
  InputStream std=p.getInputStream();
  BufferedReader stdr=new BufferedReader(new InputStreamReader(std,CHARSET));
  StringBuffer sb=new StringBuffer();
  String l1=null;
  while ((l1=stdr.readLine()) != null) {
    sb.append(l1);
    sb.append('\n');
  }
  InputStream err=p.getErrorStream();
  BufferedReader errr=new BufferedReader(new InputStreamReader(err,CHARSET));
  String l2=null;
  while ((l2=errr.readLine()) != null)   if (addStdErr) {
    sb.append(l2);
    sb.append('\n');
  }
 else   System.err.println(l2);
  stdr.close();
  errr.close();
  if (checkExitCode)   logEndTime(p,cmd,startTime);
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Execute a command with the OS and return the output in a string.
 * @param cmd Command to execute
 * @param addStdErr add the output of stderr in the result
 * @return a string with the output the command
 * @throws IOException if an error occurs while running the process
 */
public static String execToString(final String cmd,final boolean addStdErr,final boolean checkExitCode) throws IOException {
  logger.fine("String_Node_Str" + Thread.currentThread().getId() + "String_Node_Str"+ cmd);
  final long startTime=System.currentTimeMillis();
  final Process p=Runtime.getRuntime().exec(new String[]{"String_Node_Str","String_Node_Str",cmd});
  final InputStream std=p.getInputStream();
  final BufferedReader stdr=new BufferedReader(new InputStreamReader(std,CHARSET));
  final StringBuilder sb=new StringBuilder();
  String l1=null;
  while ((l1=stdr.readLine()) != null) {
    sb.append(l1);
    sb.append('\n');
  }
  InputStream err=p.getErrorStream();
  BufferedReader errr=new BufferedReader(new InputStreamReader(err,CHARSET));
  String l2=null;
  while ((l2=errr.readLine()) != null)   if (addStdErr) {
    sb.append(l2);
    sb.append('\n');
  }
 else   System.err.println(l2);
  stdr.close();
  errr.close();
  if (checkExitCode)   logEndTime(p,cmd,startTime);
  return sb.toString();
}
Program: 141265
Project: 141265
Buggy source:
/** 
 * Return a set withs pid of existing executable.
 * @return a set of integers with pid of existing executable
 */
public static Set<Integer> getExecutablePids(final String executableName){
  if (executableName == null)   return null;
  Set<Integer> result=new HashSet<Integer>();
  try {
    final String s=ProcessUtils.execToString("String_Node_Str" + executableName.trim());
    if (s == null)     return result;
    final String[] lines=s.split("String_Node_Str");
    for (    String line : lines)     try {
      result.add(Integer.parseInt(line));
    }
 catch (    NumberFormatException e) {
      continue;
    }
  }
 catch (  IOException e) {
    return result;
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Return a set withs pid of existing executable.
 * @return a set of integers with pid of existing executable
 */
public static Set<Integer> getExecutablePids(final String executableName){
  if (executableName == null)   return null;
  Set<Integer> result=new HashSet<Integer>();
  try {
    final String s=ProcessUtils.execToString("String_Node_Str" + executableName.trim());
    final String[] lines=s.split("String_Node_Str");
    for (    String line : lines)     try {
      result.add(Integer.parseInt(line));
    }
 catch (    NumberFormatException e) {
      continue;
    }
  }
 catch (  IOException e) {
    return result;
  }
  return result;
}
Program: 141268
Project: 141268
Buggy source:
public void writeStringAsFile(final String outputFilename,final String value) throws REngineException {
  if (outputFilename == null)   return;
  PrintWriter pw=new PrintWriter(getFileOutputStream(outputFilename));
  if (value != null)   pw.write(value);
  pw.close();
}

Fixed version (ground truth):
public void writeStringAsFile(final String outputFilename,final String value) throws REngineException {
  if (outputFilename == null)   return;
  try {
    final Writer writer=FileUtils.createBufferedWriter(getFileOutputStream(outputFilename));
    if (value != null) {
      writer.write(value);
      writer.close();
    }
  }
 catch (  IOException e) {
    throw new REngineException(getRConnection(),"String_Node_Str" + e.getMessage());
  }
}
Program: 141270
Project: 141270
Buggy source:
private static synchronized void readManifest(){
  if (manifestProperties != null) {
    return;
  }
  try {
    manifestProperties=new Properties();
    final InputStream is=Globals.class.getResourceAsStream(MANIFEST_PROPERTIES_FILE);
    if (is == null) {
      return;
    }
    manifestProperties.load(is);
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
private static synchronized void readManifest(){
  if (manifestProperties != null) {
    return;
  }
  try {
    manifestProperties=new Properties();
    final InputStream is=Globals.class.getResourceAsStream(MANIFEST_PROPERTIES_FILE);
    if (is == null) {
      return;
    }
    manifestProperties.load(is);
    is.close();
  }
 catch (  IOException e) {
  }
}
Program: 141271
Project: 141271
Buggy source:
/** 
 * Get the value of the setting as a double value
 * @return the value of the setting as an double
 * @throws EoulsanException if the value is not an double
 */
public double getDoubleSetting(final String settingName) throws EoulsanException {
  final String value=getSetting(settingName);
  if (value == null)   throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  try {
    return Double.parseDouble(value);
  }
 catch (  NumberFormatException e) {
    throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  }
}

Fixed version (ground truth):
/** 
 * Get the value of the setting as a double value
 * @return the value of the setting as an double
 * @throws EoulsanException if the value is not an double
 */
public double getDoubleSetting(final String settingName) throws EoulsanException {
  if (settingName == null)   throw new EoulsanException("String_Node_Str");
  final String value=getSetting(settingName);
  if (value == null)   throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  try {
    return Double.parseDouble(value);
  }
 catch (  NumberFormatException e) {
    throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  }
}
Program: 141272
Project: 141272
Buggy source:
/** 
 * Get the value of the setting as a integer value
 * @return the value of the setting as an integer
 * @throws EoulsanException if the value is not an integer
 */
public int getIntSetting(final String settingName) throws EoulsanException {
  final String value=getSetting(settingName);
  if (value == null)   throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  try {
    return Integer.parseInt(value);
  }
 catch (  NumberFormatException e) {
    throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  }
}

Fixed version (ground truth):
/** 
 * Get the value of the setting as a integer value
 * @return the value of the setting as an integer
 * @throws EoulsanException if the value is not an integer
 */
public int getIntSetting(final String settingName) throws EoulsanException {
  if (settingName == null)   throw new EoulsanException("String_Node_Str");
  final String value=getSetting(settingName);
  if (value == null)   throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  try {
    return Integer.parseInt(value);
  }
 catch (  NumberFormatException e) {
    throw new EoulsanException("String_Node_Str" + settingName + "String_Node_Str"+ value);
  }
}
Program: 141273
Project: 141273
Buggy source:
@Override public boolean equals(final Object o){
  if (o == this)   return true;
  if (o == null)   return false;
  final Alphabet that=(Alphabet)o;
  return Utils.equal(this.getName(),that.getName()) && this.getLetters().equals(that.getLetters()) && this.isLowerCaseValid() == that.isLowerCaseValid();
}

Fixed version (ground truth):
@Override public boolean equals(final Object o){
  if (o == this)   return true;
  if (o == null)   return false;
  if (!(o instanceof Alphabet))   return false;
  final Alphabet that=(Alphabet)o;
  return Utils.equal(this.getName(),that.getName()) && this.getLetters().equals(that.getLetters()) && this.isLowerCaseValid() == that.isLowerCaseValid();
}