nus-yam/ex-repair huggingface dataset:
Program: 149582
Project: 149582
Buggy source:
/** 
 * @return The function solver for the current configuration
 */
public FunctionSolver getFunctionSolver(){
  if (functionSolver == null)   functionSolver=createFitSolver();
  return functionSolver;
}

Fixed version (ground truth):
/** 
 * @return The function solver for the current configuration
 */
public FunctionSolver getFunctionSolver(){
  if (functionSolver == null)   functionSolver=createFunctionSolver();
  return functionSolver;
}
Program: 149585
Project: 149585
Buggy source:
private void runManualTracing(){
  if (!showManualTracingDialog())   return;
  startLog();
  int timeInFrames=FastMath.max(1,(int)Math.round(tThreshold / results.getCalibration().exposureTime));
  ArrayList<Molecule> singles=new ArrayList<Molecule>();
  molecules=traceMolecules(results,dThreshold,timeInFrames,singles);
  molecules.addAll(singles);
}

Fixed version (ground truth):
private void runManualTracing(){
  if (!showManualTracingDialog())   return;
  startLog();
  int timeInFrames=FastMath.max(1,(int)Math.round(tThreshold * 1000.0 / results.getCalibration().exposureTime));
  ArrayList<Molecule> singles=new ArrayList<Molecule>();
  molecules=traceMolecules(results,dThreshold,timeInFrames,singles);
  molecules.addAll(singles);
}
Program: 149589
Project: 149589
Buggy source:
private boolean getCorrelationResults(){
  String[] options=new String[]{INPUT_FROM_FILE,"String_Node_Str","String_Node_Str"};
  int count=1;
  if (previous_gr != null)   options[count++]=INPUT_PREVIOUS;
  if (!PCPALMAnalysis.results.isEmpty())   options[count++]=INPUT_ANALYSIS;
  options=Arrays.copyOf(options,count);
  GenericDialog gd=new GenericDialog(TITLE);
  gd.addMessage("String_Node_Str");
  gd.addChoice("String_Node_Str",options,inputOption);
  gd.showDialog();
  if (gd.wasCanceled())   return false;
  inputOption=gd.getNextChoice();
  if (inputOption.equals(INPUT_PREVIOUS)) {
    if (previous_gr == null)     return false;
    gr=previous_gr;
    peakDensity=previous_peakDensity;
    spatialDomain=previous_spatialDomain;
    return true;
  }
  if (inputOption.equals(INPUT_FROM_FILE)) {
    return loadCorrelationCurve();
  }
  ArrayList<CorrelationResult> results=new ArrayList<CorrelationResult>();
  if (!selectAnalysisResults(results))   return false;
  header();
  log("String_Node_Str",results.size());
  spatialDomain=results.get(0).spatialDomain;
  peakDensity=0;
  int size=0;
  for (  CorrelationResult r : results) {
    peakDensity+=r.peakDensity;
    size=Math.max(size,r.gr[0].length);
  }
  peakDensity/=results.size();
  gr=combineCurves(results,size);
  return true;
}

Fixed version (ground truth):
private boolean getCorrelationResults(){
  String[] options=new String[]{INPUT_FROM_FILE,"String_Node_Str","String_Node_Str"};
  int count=1;
  if (previous_gr != null)   options[count++]=INPUT_PREVIOUS;
  if (!PCPALMAnalysis.results.isEmpty())   options[count++]=INPUT_ANALYSIS;
  options=Arrays.copyOf(options,count);
  GenericDialog gd=new GenericDialog(TITLE);
  gd.addMessage("String_Node_Str");
  gd.addChoice("String_Node_Str",options,inputOption);
  gd.showDialog();
  if (gd.wasCanceled())   return false;
  inputOption=gd.getNextChoice();
  if (inputOption.equals(INPUT_PREVIOUS)) {
    if (previous_gr == null)     return false;
    gr=previous_gr;
    peakDensity=previous_peakDensity;
    spatialDomain=previous_spatialDomain;
    return true;
  }
 else   if (inputOption.equals(INPUT_FROM_FILE)) {
    return loadCorrelationCurve();
  }
  ArrayList<CorrelationResult> results=new ArrayList<CorrelationResult>();
  if (!selectAnalysisResults(results))   return false;
  header();
  log("String_Node_Str",results.size());
  spatialDomain=results.get(0).spatialDomain;
  peakDensity=0;
  int size=0;
  for (  CorrelationResult r : results) {
    peakDensity+=r.peakDensity;
    size=Math.max(size,r.gr[0].length);
  }
  peakDensity/=results.size();
  gr=combineCurves(results,size);
  return true;
}
Program: 149592
Project: 149592
Buggy source:
/** 
 * Fits a 2D Gaussian to the given data. Fits all the specified peaks. <p> Data must be arranged in yx block order, i.e. height rows of width.
 * @param data
 * @param width
 * @param height
 * @param index Index of the data to fit
 * @param estimatedHeight Estimated height for the peak (input from smoothed data)
 * @return Array containing the fitted curve data: The first value is the Background. The remaining values areAmplitude, PosX, PosY, StdDevX, StdDevY for each fitted peak. <p> Null if no fit is possible.
 */
private float[] fitSingle(Gaussian2DFitter gf,float[] data,int width,int height,int index,float estimatedHeight){
  this.fitResult=gf.fit(data,width,height,new int[]{index},new float[]{estimatedHeight});
  if (fitResult.getStatus() == FitStatus.OK) {
    chiSquared=fitResult.getError();
    float[] params=fitResult.getParameters();
    convertParameters(params);
    return params;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Fits a 2D Gaussian to the given data. Fits all the specified peaks. <p> Data must be arranged in yx block order, i.e. height rows of width.
 * @param data
 * @param width
 * @param height
 * @param index Index of the data to fit
 * @param estimatedHeight Estimated height for the peak (input from smoothed data)
 * @return Array containing the fitted curve data: The first value is the Background. The remaining values areAmplitude, PosX, PosY, StdDevX, StdDevY for each fitted peak. <p> Null if no fit is possible.
 */
private float[] fitSingle(Gaussian2DFitter gf,float[] data,int width,int height,int index,float estimatedHeight){
  this.fitResult=gf.fit(data,width,height,new int[]{index},new float[]{estimatedHeight});
  if (fitResult.getStatus() == FitStatus.OK) {
    chiSquared=fitResult.getError();
    float[] params=fitResult.getParameters();
    convertParameters(params);
    if (params[Gaussian2DFunction.X_POSITION] < 0 || params[Gaussian2DFunction.X_POSITION] > width || params[Gaussian2DFunction.Y_POSITION] < 0 || params[Gaussian2DFunction.Y_POSITION] > height) {
      fitResult=new FitResult(FitStatus.COORDINATES_MOVED,fitResult.getDegreesOfFreedom(),fitResult.getError(),fitResult.getInitialParameters(),fitResult.getParameters(),fitResult.getParameterStdDev(),fitResult.getNumberOfPeaks(),fitResult.getNumberOfFittedParameters(),fitResult.getStatusData());
      return null;
    }
    return params;
  }
  return null;
}
Program: 149593
Project: 149593
Buggy source:
private String getReason(FitStatus status){
switch (status) {
case SINGULAR_NON_LINEAR_MODEL:
    return "String_Node_Str";
case FAILED_TO_CONVERGE:
  return "String_Node_Str";
default :
return "String_Node_Str" + status.toString().toLowerCase(null).replace("String_Node_Str","String_Node_Str");
}
}

Fixed version (ground truth):
private String getReason(FitStatus status){
switch (status) {
case SINGULAR_NON_LINEAR_MODEL:
    return "String_Node_Str";
case FAILED_TO_CONVERGE:
  return "String_Node_Str";
default :
return "String_Node_Str" + status.toString().toLowerCase().replace("String_Node_Str","String_Node_Str");
}
}
Program: 149594
Project: 149594
Buggy source:
public synchronized void write(String description,S sequence){
  try {
    outputStream.write('>');
    if (description != null)     outputStream.write(description.getBytes());
    outputStream.write('\n');
    byte[] seq=sequence.toString().getBytes();
    int pointer=0;
    while (true) {
      if (seq.length - pointer <= maxLength) {
        outputStream.write(seq,pointer,seq.length - pointer);
        break;
      }
 else {
        outputStream.write(seq,pointer,maxLength);
        pointer+=maxLength;
      }
    }
    outputStream.write('\n');
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public synchronized void write(String description,S sequence){
  try {
    outputStream.write('>');
    if (description != null)     outputStream.write(description.getBytes());
    outputStream.write('\n');
    byte[] seq=sequence.toString().getBytes();
    int pointer=0;
    do {
      if (seq.length - pointer <= maxLength)       outputStream.write(seq,pointer,seq.length - pointer);
 else       outputStream.write(seq,pointer,maxLength);
      pointer+=maxLength;
      outputStream.write('\n');
    }
 while (seq.length > pointer);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 149595
Project: 149595
Buggy source:
public Map.Entry<Range,S> ensureEntry(Range range){
  Range direct=range.isReverse() ? range.inverse() : range;
  Map.Entry<Range,S> entry=sequences.findContaining(direct);
  if (entry != null)   return entry;
  List<Map.Entry<Range,S>> allIntersecting=sequences.findAllIntersectingOrTouching(range);
  int resFrom=range.getFrom(), resTo=range.getTo();
  if (!allIntersecting.isEmpty()) {
    Range tmp=allIntersecting.get(0).getKey();
    if (tmp.containsBoundary(resFrom)) {
      resFrom=Math.min(resFrom,tmp.getFrom());
    }
    tmp=allIntersecting.get(allIntersecting.size() - 1).getKey();
    if (tmp.containsBoundary(resTo)) {
      resTo=Math.max(resTo,tmp.getTo());
    }
  }
  Range rr=new Range(resFrom,resTo);
  S seq=provider.getRegion(rr);
  for (  Map.Entry<Range,S> e : allIntersecting) {
    int length=e.getKey().length();
    S s=e.getValue();
    for (int i=0, j=e.getKey().getFrom() - rr.getFrom(); i < length; ++i, ++j)     if (seq.codeAt(j) != s.codeAt(i))     throw new IllegalStateException("String_Node_Str");
    sequences.remove(e.getKey());
  }
  sequences.put(rr,seq);
  return new AbstractMap.SimpleEntry<>(rr,seq);
}

Fixed version (ground truth):
public Map.Entry<Range,S> ensureEntry(Range range){
  if (range.isReverse())   throw new IllegalArgumentException("String_Node_Str");
  Range direct=range.isReverse() ? range.inverse() : range;
  Map.Entry<Range,S> entry=sequences.findContaining(direct);
  if (entry != null)   return entry;
  List<Map.Entry<Range,S>> allIntersecting=sequences.findAllIntersectingOrTouching(range);
  int resFrom=range.getFrom(), resTo=range.getTo();
  if (!allIntersecting.isEmpty()) {
    Range tmp=allIntersecting.get(0).getKey();
    if (tmp.containsBoundary(resFrom)) {
      resFrom=Math.min(resFrom,tmp.getFrom());
    }
    tmp=allIntersecting.get(allIntersecting.size() - 1).getKey();
    if (tmp.containsBoundary(resTo)) {
      resTo=Math.max(resTo,tmp.getTo());
    }
  }
  Range rr=new Range(resFrom,resTo);
  S seq=provider.getRegion(rr);
  for (  Map.Entry<Range,S> e : allIntersecting) {
    int length=e.getKey().length();
    S s=e.getValue();
    for (int i=0, j=e.getKey().getFrom() - rr.getFrom(); i < length; ++i, ++j)     if (seq.codeAt(j) != s.codeAt(i))     throw new IllegalStateException("String_Node_Str");
    sequences.remove(e.getKey());
  }
  sequences.put(rr,seq);
  return new AbstractMap.SimpleEntry<>(rr,seq);
}
Program: 149597
Project: 149597
Buggy source:
public void printResult(String title,BenchmarkResults result){
  System.out.println(title);
  System.out.println("String_Node_Str" + TestUtil.time(result.getAverageTiming()));
  System.out.println("String_Node_Str" + result.getStat().totalTime.mean() + "String_Node_Str");
  System.out.println("String_Node_Str" + result.getStat().seedExtractionTime.mean() + "String_Node_Str");
  System.out.println("String_Node_Str" + result.getStat().hitCalculationTime.mean() + "String_Node_Str");
  System.out.println("String_Node_Str" + result.getStat().mapperTotalTime.mean() + "String_Node_Str");
  System.out.println("String_Node_Str" + result.getStat().alignerTime.mean() + "String_Node_Str");
  System.out.println("String_Node_Str" + (result.getBadFraction() * 100) + "String_Node_Str");
  System.out.println();
}

Fixed version (ground truth):
public static void printResult(String title,BenchmarkResults result){
  System.out.println(title);
  System.out.println("String_Node_Str" + TestUtil.time(result.getAverageTiming()));
  System.out.println("String_Node_Str" + result.getStat().totalTime.mean() + "String_Node_Str");
  System.out.println("String_Node_Str" + result.getStat().seedExtractionTime.mean() + "String_Node_Str");
  System.out.println("String_Node_Str" + result.getStat().hitCalculationTime.mean() + "String_Node_Str");
  System.out.println("String_Node_Str" + result.getStat().mapperTotalTime.mean() + "String_Node_Str");
  System.out.println("String_Node_Str" + result.getStat().alignerTime.mean() + "String_Node_Str");
  System.out.println("String_Node_Str" + (result.getBadFraction() * 100) + "String_Node_Str");
  System.out.println();
}
Program: 149598
Project: 149598
Buggy source:
public Alignment(S sequence1,Mutations<S> mutations,Range sequence1Range,Range sequence2Range,float score){
  if (!mutations.isEmpty()) {
    if (!mutations.isCompatibleWith(sequence1) || !sequence1Range.contains(mutations.getMutatedRange()) || sequence1Range.length() + mutations.getLengthDelta() != sequence2Range.length())     throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (sequence1Range.length() != sequence2Range.length())   throw new IllegalArgumentException("String_Node_Str");
  this.sequence1=sequence1;
  this.mutations=mutations;
  this.sequence1Range=sequence1Range;
  this.sequence2Range=sequence2Range;
  this.score=score;
}

Fixed version (ground truth):
public Alignment(S sequence1,Mutations<S> mutations,Range sequence1Range,Range sequence2Range,float score){
  if (!mutations.isEmpty()) {
    if (!mutations.isCompatibleWith(sequence1) || !sequence1Range.contains(mutations.getMutatedRange()) || sequence1Range.length() + mutations.getLengthDelta() != sequence2Range.length())     throw new IllegalArgumentException("String_Node_Str" + mutations + "String_Node_Str"+ sequence1Range+ "String_Node_Str"+ sequence2Range);
  }
 else   if (sequence1Range.length() != sequence2Range.length())   throw new IllegalArgumentException("String_Node_Str");
  this.sequence1=sequence1;
  this.mutations=mutations;
  this.sequence1Range=sequence1Range;
  this.sequence2Range=sequence2Range;
  this.score=score;
}
Program: 149602
Project: 149602
Buggy source:
public BenchmarkResults(BenchmarkInput input,KAligner2Statistics stat,long executionTime,int processedQueries,int mismatched,int noHits){
  this.input=input;
  this.stat=stat;
  this.executionTime=executionTime;
  this.processedQueries=processedQueries;
  this.mismatched=mismatched;
  this.noHits=noHits;
}

Fixed version (ground truth):
public BenchmarkResults(BenchmarkInput input,KAligner2Statistics stat,long executionTime,int processedQueries,int processedGoodQueries,int falsePositives,int mismatched,int noHits,int scoreError){
  this.input=input;
  this.stat=stat;
  this.executionTime=executionTime;
  this.processedQueries=processedQueries;
  this.processedGoodQueries=processedGoodQueries;
  this.falsePositives=falsePositives;
  this.mismatched=mismatched;
  this.noHits=noHits;
  this.scoreError=scoreError;
}
Program: 149603
Project: 149603
Buggy source:
public double getBadFraction(){
  return 1.0 * (noHits + mismatched) / processedQueries;
}

Fixed version (ground truth):
public double getBadFraction(){
  return 1.0 * (noHits + mismatched) / processedGoodQueries;
}
Program: 149604
Project: 149604
Buggy source:
public double getNoHitsFraction(){
  return 1.0 * noHits / processedQueries;
}

Fixed version (ground truth):
public double getNoHitsFraction(){
  return 1.0 * noHits / processedGoodQueries;
}
Program: 149605
Project: 149605
Buggy source:
public double getMismatchedFraction(){
  return 1.0 * mismatched / processedQueries;
}

Fixed version (ground truth):
public double getMismatchedFraction(){
  return 1.0 * mismatched / processedGoodQueries;
}
Program: 149606
Project: 149606
Buggy source:
public ChallengeParameters(int dbSize,int dbMinSeqLength,int dbMaxSeqLength,int queryCount,int minClusters,int maxClusters,int minClusterLength,int maxClusterLength,int minIndelLength,int maxIndelLength,double insertionProbability,double deletionProbability,double boundaryInsertProbability,NucleotideMutationModel mutationModel,int minAlignmentScoring,int maxAlignmentScoring,AffineGapAlignmentScoring<NucleotideSequence> scoring){
  this.dbSize=dbSize;
  this.dbMinSeqLength=dbMinSeqLength;
  this.dbMaxSeqLength=dbMaxSeqLength;
  this.queryCount=queryCount;
  this.minClusters=minClusters;
  this.maxClusters=maxClusters;
  this.minClusterLength=minClusterLength;
  this.maxClusterLength=maxClusterLength;
  this.minIndelLength=minIndelLength;
  this.maxIndelLength=maxIndelLength;
  this.insertionProbability=insertionProbability;
  this.deletionProbability=deletionProbability;
  this.boundaryInsertProbability=boundaryInsertProbability;
  this.mutationModel=mutationModel;
  this.minAlignmentScoring=minAlignmentScoring;
  this.maxAlignmentScoring=maxAlignmentScoring;
  this.scoring=scoring;
}

Fixed version (ground truth):
public ChallengeParameters(int dbSize,int dbMinSeqLength,int dbMaxSeqLength,int queryCount,int falseCount,int minClusters,int maxClusters,int minClusterLength,int maxClusterLength,int minIndelLength,int maxIndelLength,double insertionProbability,double deletionProbability,double boundaryInsertProbability,NucleotideMutationModel mutationModel,int minAlignmentScoring,int maxAlignmentScoring,AffineGapAlignmentScoring<NucleotideSequence> scoring){
  this.dbSize=dbSize;
  this.dbMinSeqLength=dbMinSeqLength;
  this.dbMaxSeqLength=dbMaxSeqLength;
  this.queryCount=queryCount;
  this.falseCount=falseCount;
  this.minClusters=minClusters;
  this.maxClusters=maxClusters;
  this.minClusterLength=minClusterLength;
  this.maxClusterLength=maxClusterLength;
  this.minIndelLength=minIndelLength;
  this.maxIndelLength=maxIndelLength;
  this.insertionProbability=insertionProbability;
  this.deletionProbability=deletionProbability;
  this.boundaryInsertProbability=boundaryInsertProbability;
  this.mutationModel=mutationModel;
  this.minAlignmentScoring=minAlignmentScoring;
  this.maxAlignmentScoring=maxAlignmentScoring;
  this.scoring=scoring;
}
Program: 149607
Project: 149607
Buggy source:
public ChallengeParameters setQueryCount(int newCount){
  return new ChallengeParameters(dbSize,dbMinSeqLength,dbMaxSeqLength,newCount,minClusters,maxClusters,minClusterLength,maxClusterLength,minIndelLength,maxIndelLength,insertionProbability,deletionProbability,boundaryInsertProbability,mutationModel,minAlignmentScoring,maxAlignmentScoring,scoring);
}

Fixed version (ground truth):
public ChallengeParameters setQueryCount(int newCount){
  return new ChallengeParameters(dbSize,dbMinSeqLength,dbMaxSeqLength,newCount,falseCount,minClusters,maxClusters,minClusterLength,maxClusterLength,minIndelLength,maxIndelLength,insertionProbability,deletionProbability,boundaryInsertProbability,mutationModel,minAlignmentScoring,maxAlignmentScoring,scoring);
}
Program: 149608
Project: 149608
Buggy source:
public static ChallengeParameters getParamsOneCluster(AffineGapAlignmentScoring<NucleotideSequence> scoring,int minAlignmentScoring,int maxAlignmentScoring,double multiplier){
  return new ChallengeParameters(100,350,500,1000000,1,1,35,80,30,100,0.45,0.45,0.5,new GenericNucleotideMutationModel(SubstitutionModels.getEmpiricalNucleotideSubstitutionModel(),deletionProbability,insertionProbability).multiplyProbabilities(multiplier),minAlignmentScoring,maxAlignmentScoring,scoring);
}

Fixed version (ground truth):
public static ChallengeParameters getParamsOneCluster(AffineGapAlignmentScoring<NucleotideSequence> scoring,int minAlignmentScoring,int maxAlignmentScoring,double multiplier){
  return new ChallengeParameters(100,350,500,1000000,1000000,1,1,35,80,30,100,0.45,0.45,0.5,new GenericNucleotideMutationModel(SubstitutionModels.getEmpiricalNucleotideSubstitutionModel(),deletionProbability,insertionProbability).multiplyProbabilities(multiplier),minAlignmentScoring,maxAlignmentScoring,scoring);
}
Program: 149609
Project: 149609
Buggy source:
public static ChallengeParameters getParamsTwoClusters(AffineGapAlignmentScoring<NucleotideSequence> scoring,int minAlignmentScoring,int maxAlignmentScoring,double multiplier){
  return new ChallengeParameters(100,350,500,1000000,2,2,35,100,30,80,0.45,0.45,0.5,new GenericNucleotideMutationModel(SubstitutionModels.getEmpiricalNucleotideSubstitutionModel(),deletionProbability,insertionProbability).multiplyProbabilities(multiplier),minAlignmentScoring,maxAlignmentScoring,scoring);
}

Fixed version (ground truth):
public static ChallengeParameters getParamsTwoClusters(AffineGapAlignmentScoring<NucleotideSequence> scoring,int minAlignmentScoring,int maxAlignmentScoring,double multiplier){
  return new ChallengeParameters(100,350,500,1000000,1000000,2,2,35,100,30,80,0.45,0.45,0.5,new GenericNucleotideMutationModel(SubstitutionModels.getEmpiricalNucleotideSubstitutionModel(),deletionProbability,insertionProbability).multiplyProbabilities(multiplier),minAlignmentScoring,maxAlignmentScoring,scoring);
}
Program: 149610
Project: 149610
Buggy source:
public static ChallengeParameters getParams1NoGap(AffineGapAlignmentScoring<NucleotideSequence> scoring,int minAlignmentScoring,int maxAlignmentScoring,double multiplier){
  return new ChallengeParameters(100,100,500,100000,1,4,15,50,3,30,0.45,0.45,0.5,new GenericNucleotideMutationModel(SubstitutionModels.getEmpiricalNucleotideSubstitutionModel(),0,0).multiplyProbabilities(multiplier),minAlignmentScoring,maxAlignmentScoring,scoring);
}

Fixed version (ground truth):
public static ChallengeParameters getParams1NoGap(AffineGapAlignmentScoring<NucleotideSequence> scoring,int minAlignmentScoring,int maxAlignmentScoring,double multiplier){
  return new ChallengeParameters(100,100,500,100000,1000000,1,4,15,50,3,30,0.45,0.45,0.5,new GenericNucleotideMutationModel(SubstitutionModels.getEmpiricalNucleotideSubstitutionModel(),0,0).multiplyProbabilities(multiplier),minAlignmentScoring,maxAlignmentScoring,scoring);
}
Program: 149611
Project: 149611
Buggy source:
public KAlignerQuery(int targetId,List<Range> queryClusters,List<Range> targetClusters,List<Mutations<NucleotideSequence>> mutationsInTarget,NucleotideSequence query,Alignment<NucleotideSequence> expectedAlignment){
  this.targetId=targetId;
  this.queryClusters=queryClusters;
  this.targetClusters=targetClusters;
  this.mutationsInTarget=mutationsInTarget;
  this.query=query;
  this.expectedAlignment=expectedAlignment;
}

Fixed version (ground truth):
public KAlignerQuery(NucleotideSequence sequence){
  this(-1,null,null,null,sequence,null);
}
Program: 149612
Project: 149612
Buggy source:
public BatchAlignmentResult<S> align(final S sequence){
  ArrayList<BatchAlignmentHit<S>> alignments=new ArrayList<>(references.size());
  for (int i=0; i < alignments.size(); i++)   alignments.add(alignSingle(i,sequence));
  Collections.sort(alignments,new HitComparator());
  float topScore=alignments.get(0).getAlignment().getScore();
  float scoreThreshold=Math.max(topScore * parameters.getRelativeMinScore(),parameters.getAbsoluteMinScore());
  for (int i=0; i < alignments.size(); i++)   if (i == parameters.getMaxHits() || alignments.get(i).getAlignment().getScore() < scoreThreshold)   return new BatchAlignmentResult<>(new ArrayList<>(alignments.subList(0,i)));
  return new BatchAlignmentResult<>(alignments);
}

Fixed version (ground truth):
public BatchAlignmentResult<S> align(final S sequence){
  ArrayList<BatchAlignmentHit<S>> alignments=new ArrayList<>(references.size());
  for (int i=0; i < references.size(); i++)   alignments.add(alignSingle(i,sequence));
  Collections.sort(alignments,new HitComparator());
  float topScore=alignments.get(0).getAlignment().getScore();
  float scoreThreshold=Math.max(topScore * parameters.getRelativeMinScore(),parameters.getAbsoluteMinScore());
  for (int i=0; i < alignments.size(); i++)   if (i == parameters.getMaxHits() || alignments.get(i).getAlignment().getScore() < scoreThreshold)   return new BatchAlignmentResult<>(new ArrayList<>(alignments.subList(0,i)));
  return new BatchAlignmentResult<>(alignments);
}
Program: 149613
Project: 149613
Buggy source:
@Override public synchronized void write(SingleRead read){
  int pointer=this.pointer;
  String description=read.getDescription();
  int len=description.length();
  flushIfNeededToWrite(len + 1);
  buffer[pointer++]='@';
  for (int i=0; i < len; ++i)   buffer[pointer++]=(byte)description.charAt(i);
  NucleotideSequence sequence=read.getData().getSequence();
  SequenceQuality quality=read.getData().getQuality();
  len=sequence.size();
  flushIfNeededToWrite(len + 2);
  buffer[pointer++]='\n';
  for (int i=0; i < len; ++i)   buffer[pointer++]=NucleotideAlphabet.symbolByteFromCode(sequence.codeAt(i));
  buffer[pointer++]='\n';
  flushIfNeededToWrite(len + 3);
  buffer[pointer++]='+';
  buffer[pointer++]='\n';
  quality.encodeTo(qualityFormat,buffer,pointer);
  pointer+=len;
  buffer[pointer++]='\n';
  this.pointer=pointer;
}

Fixed version (ground truth):
@Override public synchronized void write(SingleRead read){
  String description=read.getDescription();
  int len=description.length();
  flushIfNeededToWrite(len + 1);
  buffer[pointer++]='@';
  for (int i=0; i < len; ++i)   buffer[pointer++]=(byte)description.charAt(i);
  NucleotideSequence sequence=read.getData().getSequence();
  SequenceQuality quality=read.getData().getQuality();
  len=sequence.size();
  flushIfNeededToWrite(len + 2);
  buffer[pointer++]='\n';
  for (int i=0; i < len; ++i)   buffer[pointer++]=NucleotideAlphabet.symbolByteFromCode(sequence.codeAt(i));
  buffer[pointer++]='\n';
  flushIfNeededToWrite(len + 3);
  buffer[pointer++]='+';
  buffer[pointer++]='\n';
  quality.encodeTo(qualityFormat,buffer,pointer);
  pointer+=len;
  buffer[pointer++]='\n';
}
Program: 149614
Project: 149614
Buggy source:
public void flushIfNeededToWrite(int sizeToWrite){
  if (buffer.length - pointer < sizeToWrite)   flush();
}

Fixed version (ground truth):
private void flushIfNeededToWrite(int sizeToWrite){
  if (buffer.length - pointer < sizeToWrite)   flush();
}
Program: 149615
Project: 149615
Buggy source:
@Override public SequenceBuilder<S> getBuilder(){
  return new ArraySequenceBuilder<S>(this);
}

Fixed version (ground truth):
@Override public SequenceBuilder<S> getBuilder(){
  return new ArraySequenceBuilder<>(this);
}
Program: 149616
Project: 149616
Buggy source:
@Override public B append(S seq){
  ensureInternalCapacity(size + seq.size());
  System.arraycopy(getUnsafe(seq),0,data,size,seq.size());
  size+=seq.size();
  return (B)this;
}

Fixed version (ground truth):
@Override public B append(S seq){
  if (seq.size() == 0)   return (B)this;
  ensureInternalCapacity(size + seq.size());
  System.arraycopy(getUnsafe(seq),0,data,size,seq.size());
  size+=seq.size();
  return (B)this;
}
Program: 149617
Project: 149617
Buggy source:
@Override public SequenceBuilder<S> append(byte[] letters){
  ensureInternalCapacity(size + letters.length);
  System.arraycopy(letters,0,data,size,letters.length);
  size+=letters.length;
  return this;
}

Fixed version (ground truth):
@Override public SequenceBuilder<S> append(byte[] letters){
  if (letters.length == 0)   return this;
  ensureInternalCapacity(size + letters.length);
  System.arraycopy(letters,0,data,size,letters.length);
  size+=letters.length;
  return this;
}
Program: 149618
Project: 149618
Buggy source:
private void ensureInternalCapacity(int newSize){
  if (size == -1)   throw new IllegalStateException("String_Node_Str");
  if (storage == null && newSize != 0)   storage=new Bit2Array(Math.max(newSize,10));
  if (storage.size() < newSize)   storage=storage.extend(Math.max(newSize,3 * storage.size() / 2 + 1));
}

Fixed version (ground truth):
private void ensureInternalCapacity(int newSize){
  if (size == -1)   throw new IllegalStateException("String_Node_Str");
  if (newSize > 0) {
    if (storage == null)     storage=new Bit2Array(Math.max(newSize,10));
    if (storage.size() < newSize)     storage=storage.extend(Math.max(newSize,3 * storage.size() / 2 + 1));
  }
}
Program: 149619
Project: 149619
Buggy source:
@Override public NucleotideSequenceBuilder append(NucleotideSequence seq){
  ensureInternalCapacity(size + seq.size());
  storage.copyFrom(seq.data,0,size,seq.size());
  size+=seq.size();
  return this;
}

Fixed version (ground truth):
@Override public NucleotideSequenceBuilder append(NucleotideSequence seq){
  if (seq.size() == 0)   return this;
  ensureInternalCapacity(size + seq.size());
  storage.copyFrom(seq.data,0,size,seq.size());
  size+=seq.size();
  return this;
}
Program: 149620
Project: 149620
Buggy source:
void fillBuffer(int size) throws IOException {
  if (closed.get())   return;
  byte[] newBuffer;
  if (lazyReads)   newBuffer=new byte[size];
 else {
    if (buffer == null)     buffer=new byte[size];
    if (buffer.length != size)     newBuffer=new byte[size];
 else     newBuffer=buffer;
  }
  if (buffer != null)   System.arraycopy(buffer,pointer,newBuffer,0,currentBufferSize - pointer);
  int readBytes=inputStream.read(newBuffer,currentBufferSize - pointer,newBuffer.length - currentBufferSize + pointer);
  currentBufferSize=(readBytes == -1 ? 0 : readBytes) + currentBufferSize - pointer;
  pointer=0;
  buffer=newBuffer;
  if (readBytes == -1 && autoClose)   close();
}

Fixed version (ground truth):
void fillBuffer(int size) throws IOException {
  if (closed.get())   return;
  byte[] newBuffer;
  if (lazyReads)   newBuffer=new byte[size];
 else {
    if (buffer == null)     buffer=new byte[size];
    if (buffer.length != size)     newBuffer=new byte[size];
 else     newBuffer=buffer;
  }
  if (buffer != null)   System.arraycopy(buffer,pointer,newBuffer,0,currentBufferSize - pointer);
  int readBytes=inputStream.readFully(newBuffer,currentBufferSize - pointer,newBuffer.length - currentBufferSize + pointer);
  currentBufferSize=(readBytes == -1 ? 0 : readBytes) + currentBufferSize - pointer;
  pointer=0;
  buffer=newBuffer;
  if (readBytes == -1 && autoClose)   close();
}
Program: 149621
Project: 149621
Buggy source:
private static InputDataWrapper create(final RandomAccessFile stream){
  return new InputDataWrapper(){
    @Override public int read(    byte[] buffer,    int off,    int len) throws IOException {
      return stream.read(buffer,off,len);
    }
    @Override public void close() throws IOException {
      stream.close();
    }
  }
;
}

Fixed version (ground truth):
private static final InputDataWrapper create(final RandomAccessFile stream){
  return new InputDataWrapper(){
    @Override public int read(    byte[] buffer,    int off,    int len) throws IOException {
      return stream.read(buffer,off,len);
    }
    @Override public void close() throws IOException {
      stream.close();
    }
  }
;
}
Program: 149622
Project: 149622
Buggy source:
@Override public void readFromNBT(NBTTagCompound arg0){
  tank.readFromNBT(arg0);
  if (arg0.hasKey("String_Node_Str"))   ticksFromLastDrain=arg0.getInteger("String_Node_Str");
}

Fixed version (ground truth):
@Override public void readFromNBT(NBTTagCompound arg0){
  tank.readFromNBT(arg0);
  if (arg0.hasKey("String_Node_Str"))   ticksFromLastDrain=arg0.getInteger("String_Node_Str");
  if (arg0.hasKey("String_Node_Str"))   active=arg0.getBoolean("String_Node_Str");
}
Program: 149623
Project: 149623
Buggy source:
@Override protected void isMachineWhole() throws MultiblockValidationException {
  if (controlers.size() < 2) {
    throw new MultiblockValidationException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void isMachineWhole() throws MultiblockValidationException {
  if (controlers.size() < 2) {
    active=false;
    renderUpdate();
    throw new MultiblockValidationException("String_Node_Str");
  }
}
Program: 149624
Project: 149624
Buggy source:
@Override protected void onBlockRemoved(IMultiblockPart arg0){
  if (arg0 instanceof TileEntityControler) {
    controlers.remove((TileEntityControler)arg0);
  }
  if (arg0.worldObj.isRemote) {
    arg0.worldObj.markBlockForRenderUpdate(arg0.xCoord,arg0.yCoord,arg0.zCoord);
  }
}

Fixed version (ground truth):
@Override protected void onBlockRemoved(IMultiblockPart arg0){
  if (arg0 instanceof TileEntityControler) {
    controlers.remove((TileEntityControler)arg0);
  }
}
Program: 149625
Project: 149625
Buggy source:
@Override protected void onAssimilate(MultiblockControllerBase arg0){
  if (arg0 instanceof SuperConductor) {
  }
}

Fixed version (ground truth):
@Override protected void onAssimilate(MultiblockControllerBase arg0){
}
Program: 149626
Project: 149626
Buggy source:
@Override protected void onAssimilated(MultiblockControllerBase arg0){
}

Fixed version (ground truth):
@Override protected void onAssimilated(MultiblockControllerBase arg0){
  ((SuperConductor)arg0).getTank().fill(tank.getFluid(),true);
}
Program: 149627
Project: 149627
Buggy source:
@Override protected void onMachineDisassembled(){
}

Fixed version (ground truth):
@Override protected void onMachineDisassembled(){
  active=false;
  renderUpdate();
}
Program: 149628
Project: 149628
Buggy source:
@Override public void decodeDescriptionPacket(NBTTagCompound arg0){
  tank.readFromNBT(arg0);
  boolean lactive=arg0.getBoolean("String_Node_Str");
  System.out.println(lactive);
  if (lactive != active) {
    active=lactive;
  }
}

Fixed version (ground truth):
@Override public void decodeDescriptionPacket(NBTTagCompound arg0){
  tank.readFromNBT(arg0);
  boolean lactive=arg0.getBoolean("String_Node_Str");
  if (lactive != active) {
    active=lactive;
    renderUpdate();
  }
}
Program: 149629
Project: 149629
Buggy source:
@Override public void writeToNBT(NBTTagCompound arg0){
  tank.writeToNBT(arg0);
  arg0.setInteger("String_Node_Str",ticksFromLastDrain);
}

Fixed version (ground truth):
@Override public void writeToNBT(NBTTagCompound arg0){
  tank.writeToNBT(arg0);
  arg0.setInteger("String_Node_Str",ticksFromLastDrain);
  arg0.setBoolean("String_Node_Str",active);
}
Program: 149630
Project: 149630
Buggy source:
@Override public Icon getGlowIcon(IBlockAccess blockAccess,int x,int y,int z,int side){
  ForgeDirection[] dirsToCheck=Sides.neighborsBySide[side];
  ForgeDirection dir;
  int myBlockId=blockAccess.getBlockId(x,y,z);
  World world=blockAccess.getBlockTileEntity(x,y,z) != null ? blockAccess.getBlockTileEntity(x,y,z).worldObj : null;
  ForgeDirection out=ForgeDirection.getOrientation(side);
  if (blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == myBlockId) {
    return null;
  }
  if (isEnergyHandler(world,x + out.offsetX,y + out.offsetY,z + out.offsetZ))   return glowIcons[getBlockType(blockAccess,x,y,z)][15];
  int iconIdx=0;
  for (int i=0; i < dirsToCheck.length; i++) {
    dir=dirsToCheck[i];
    if (blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == myBlockId || isEnergyHandler(world,x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ)) {
      iconIdx|=1 << i;
    }
  }
  return glowIcons[getBlockType(blockAccess,x,y,z)][iconIdx];
}

Fixed version (ground truth):
@Override public Icon getGlowIcon(IBlockAccess blockAccess,int x,int y,int z,int side){
  TileEntityControler tile=(TileEntityControler)blockAccess.getBlockTileEntity(x,y,z);
  if (tile != null && tile.getMultiblockController() != null) {
    if (!((SuperConductor)tile.getMultiblockController()).active)     return null;
  }
 else   return null;
  ForgeDirection[] dirsToCheck=Sides.neighborsBySide[side];
  ForgeDirection dir;
  int myBlockId=blockAccess.getBlockId(x,y,z);
  World world=blockAccess.getBlockTileEntity(x,y,z) != null ? blockAccess.getBlockTileEntity(x,y,z).worldObj : null;
  ForgeDirection out=ForgeDirection.getOrientation(side);
  if (blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == myBlockId) {
    return null;
  }
  if (isEnergyHandler(world,x + out.offsetX,y + out.offsetY,z + out.offsetZ))   return glowIcons[getBlockType(blockAccess,x,y,z)][15];
  int iconIdx=0;
  for (int i=0; i < dirsToCheck.length; i++) {
    dir=dirsToCheck[i];
    if (blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == myBlockId || isEnergyHandler(world,x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ)) {
      iconIdx|=1 << i;
    }
  }
  return glowIcons[getBlockType(blockAccess,x,y,z)][iconIdx];
}
Program: 149631
Project: 149631
Buggy source:
@Override public Icon getGlowIcon(IBlockAccess blockAccess,int x,int y,int z,int side){
  ForgeDirection[] dirsToCheck=Sides.neighborsBySide[side];
  ForgeDirection dir;
  int myBlockId=blockAccess.getBlockId(x,y,z);
  ForgeDirection out=ForgeDirection.getOrientation(side);
  if (blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == myBlockId || blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == BlockControler.instance.blockID) {
    return null;
  }
  int iconIdx=0;
  for (int i=0; i < dirsToCheck.length; i++) {
    dir=dirsToCheck[i];
    if (blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == myBlockId || blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == BlockControler.instance.blockID) {
      iconIdx|=1 << i;
    }
  }
  return glowIcons[iconIdx];
}

Fixed version (ground truth):
@Override public Icon getGlowIcon(IBlockAccess blockAccess,int x,int y,int z,int side){
  TileEntityWire tile=(TileEntityWire)blockAccess.getBlockTileEntity(x,y,z);
  if (tile != null && tile.getMultiblockController() != null) {
    if (!((SuperConductor)tile.getMultiblockController()).active)     return null;
  }
 else   return null;
  ForgeDirection[] dirsToCheck=Sides.neighborsBySide[side];
  ForgeDirection dir;
  int myBlockId=blockAccess.getBlockId(x,y,z);
  ForgeDirection out=ForgeDirection.getOrientation(side);
  if (blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == myBlockId || blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == BlockControler.instance.blockID) {
    return null;
  }
  int iconIdx=0;
  for (int i=0; i < dirsToCheck.length; i++) {
    dir=dirsToCheck[i];
    if (blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == myBlockId || blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == BlockControler.instance.blockID) {
      iconIdx|=1 << i;
    }
  }
  return glowIcons[iconIdx];
}
Program: 149632
Project: 149632
Buggy source:
@Override public boolean onBlockActivated(World par1World,int par2,int par3,int par4,EntityPlayer par5EntityPlayer,int par6,float par7,float par8,float par9){
  par1World.setBlockMetadataWithNotify(par2,par3,par4,(par1World.getBlockMetadata(par2,par3,par4) | 8),2);
  par1World.scheduleBlockUpdate(par2,par3,par4,blockID,tickRate(par1World));
  int sx, sy, sz;
  sx=par2;
  sy=par3;
  sz=par4;
  TileQuarry tq=null;
  for (  ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
    if (par1World.getBlockTileEntity(sx + dir.offsetX,sy + dir.offsetY,sz + dir.offsetZ) instanceof TileQuarry) {
      tq=(TileQuarry)par1World.getBlockTileEntity(sx + dir.offsetX,sy + dir.offsetY,sz + dir.offsetZ);
      break;
    }
  }
  if (tq == null)   return false;
  Box box=tq.box;
  for (int x=box.xMin; x <= box.xMax; x++) {
    for (int y=box.yMin - 1; y >= 1; y--) {
      for (int z=box.zMin; z <= box.zMax; z++) {
        if (x == box.xMin || x == box.xMax || z == box.zMin || z == box.zMax) {
          if (BlockUtil.isSoftBlock(par1World,x,y,z))           par1World.setBlock(x,y,z,Block.stone.blockID);
          continue;
        }
        if (BuildCraftAPI.softBlocks[par1World.getBlockId(x,y,z)]) {
          par1World.setBlockToAir(x,y,z);
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World par1World,int par2,int par3,int par4,EntityPlayer par5EntityPlayer,int par6,float par7,float par8,float par9){
  if ((par1World.getBlockMetadata(par2,par3,par4) & 8) != 0)   return true;
  TileQuarry tq=null;
  int sx, sy, sz;
  sx=par2;
  sy=par3;
  sz=par4;
  for (  ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
    if (par1World.getBlockTileEntity(sx + dir.offsetX,sy + dir.offsetY,sz + dir.offsetZ) instanceof TileQuarry) {
      tq=(TileQuarry)par1World.getBlockTileEntity(sx + dir.offsetX,sy + dir.offsetY,sz + dir.offsetZ);
      break;
    }
  }
  if (tq == null)   return false;
  par1World.setBlockMetadataWithNotify(par2,par3,par4,(par1World.getBlockMetadata(par2,par3,par4) | 8),2);
  par1World.scheduleBlockUpdate(par2,par3,par4,blockID,tickRate(par1World));
  Box box=tq.box;
  for (int x=box.xMin; x <= box.xMax; x++) {
    for (int y=box.yMin - 1; y >= 1; y--) {
      for (int z=box.zMin; z <= box.zMax; z++) {
        if (x == box.xMin || x == box.xMax || z == box.zMin || z == box.zMax) {
          if (BlockUtil.isSoftBlock(par1World,x,y,z))           par1World.setBlock(x,y,z,Block.stone.blockID);
          continue;
        }
        if (BuildCraftAPI.softBlocks[par1World.getBlockId(x,y,z)]) {
          par1World.setBlockToAir(x,y,z);
        }
      }
    }
  }
  return true;
}
Program: 149633
Project: 149633
Buggy source:
@Override public void formatDescriptionPacket(NBTTagCompound arg0){
  tank.writeToNBT(arg0);
}

Fixed version (ground truth):
@Override public void formatDescriptionPacket(NBTTagCompound arg0){
  tank.writeToNBT(arg0);
  arg0.setBoolean("String_Node_Str",active);
}
Program: 149634
Project: 149634
Buggy source:
@Override protected void onBlockRemoved(IMultiblockPart arg0){
  if (arg0 instanceof TileEntityControler) {
    controlers.remove((TileEntityControler)arg0);
  }
}

Fixed version (ground truth):
@Override protected void onBlockRemoved(IMultiblockPart arg0){
  if (arg0 instanceof TileEntityControler) {
    controlers.remove((TileEntityControler)arg0);
  }
  if (arg0.worldObj.isRemote) {
    arg0.worldObj.markBlockForRenderUpdate(arg0.xCoord,arg0.yCoord,arg0.zCoord);
  }
}
Program: 149635
Project: 149635
Buggy source:
@Override protected boolean updateServer(){
  if (ticksFromLastDrain % 10 == 0) {
    for (    TileEntityControler c : controlers)     c.updateTick();
  }
  if (ticksFromLastDrain >= 864) {
    tank.drain(1,true);
    ticksFromLastDrain=0;
  }
  ticksFromLastDrain++;
  if ((float)tank.getFluidAmount() / (float)tank.getCapacity() < 0.5)   return true;
  long energyNeed=0;
  for (  TileEntityControler c : controlers) {
    if (c.isOutput()) {
      energyNeed+=c.getEnergyNeed();
    }
  }
  long currentEnergy=0;
  for (  TileEntityControler c : controlers) {
    if (!c.isOutput()) {
      int temp=c.getEnergy(energyNeed > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)energyNeed);
      currentEnergy+=temp;
      energyNeed-=temp;
      if (energyNeed <= 0)       break;
    }
  }
  for (  TileEntityControler c : controlers) {
    if (c.isOutput()) {
      currentEnergy-=c.putEnergy(currentEnergy > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)currentEnergy);
      if (currentEnergy <= 0)       break;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean updateServer(){
  if (ticksFromLastDrain % 10 == 0) {
    for (    TileEntityControler c : controlers)     c.updateTick();
  }
  if (ticksFromLastDrain >= 12 * 60 * 60* 20 / 1000) {
    tank.drain(1,true);
    ticksFromLastDrain=0;
  }
  ticksFromLastDrain++;
  boolean newactive=(float)tank.getFluidAmount() / (float)tank.getCapacity() >= 0.5;
  if (newactive != active) {
    active=newactive;
    worldObj.markBlockForUpdate(getReferenceCoord().x,getReferenceCoord().y,getReferenceCoord().z);
  }
  if (!active)   return true;
  long energyNeed=0;
  for (  TileEntityControler c : controlers) {
    if (c.isOutput()) {
      energyNeed+=c.getEnergyNeed();
    }
  }
  long currentEnergy=0;
  for (  TileEntityControler c : controlers) {
    if (!c.isOutput()) {
      int temp=c.getEnergy(energyNeed > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)energyNeed);
      currentEnergy+=temp;
      energyNeed-=temp;
      if (energyNeed <= 0)       break;
    }
  }
  for (  TileEntityControler c : controlers) {
    if (c.isOutput()) {
      currentEnergy-=c.putEnergy(currentEnergy > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)currentEnergy);
      if (currentEnergy <= 0)       break;
    }
  }
  return true;
}
Program: 149636
Project: 149636
Buggy source:
@Override protected void onAssimilate(MultiblockControllerBase arg0){
}

Fixed version (ground truth):
@Override protected void onAssimilate(MultiblockControllerBase arg0){
  if (arg0 instanceof SuperConductor) {
  }
}
Program: 149637
Project: 149637
Buggy source:
@Override public void decodeDescriptionPacket(NBTTagCompound arg0){
  tank.readFromNBT(arg0);
}

Fixed version (ground truth):
@Override public void decodeDescriptionPacket(NBTTagCompound arg0){
  tank.readFromNBT(arg0);
  boolean lactive=arg0.getBoolean("String_Node_Str");
  System.out.println(lactive);
  if (lactive != active) {
    active=lactive;
  }
}
Program: 149638
Project: 149638
Buggy source:
@Override public Icon getGlowIcon(IBlockAccess blockAccess,int x,int y,int z,int side){
  ForgeDirection[] dirsToCheck=Sides.neighborsBySide[side];
  ForgeDirection dir;
  int myBlockId=blockAccess.getBlockId(x,y,z);
  World world=blockAccess.getBlockTileEntity(x,y,z) != null ? blockAccess.getBlockTileEntity(x,y,z).worldObj : null;
  ForgeDirection out=ForgeDirection.getOrientation(side);
  if (blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == myBlockId) {
    return null;
  }
  if (isEnergyHandler(world,x + out.offsetX,y + out.offsetY,z + out.offsetZ))   return glowIcons[blockAccess.getBlockMetadata(x,y,z)][15];
  int iconIdx=0;
  for (int i=0; i < dirsToCheck.length; i++) {
    dir=dirsToCheck[i];
    if (blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == myBlockId || isEnergyHandler(world,x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ)) {
      iconIdx|=1 << i;
    }
  }
  return glowIcons[blockAccess.getBlockMetadata(x,y,z)][iconIdx];
}

Fixed version (ground truth):
@Override public Icon getGlowIcon(IBlockAccess blockAccess,int x,int y,int z,int side){
  ForgeDirection[] dirsToCheck=Sides.neighborsBySide[side];
  ForgeDirection dir;
  int myBlockId=blockAccess.getBlockId(x,y,z);
  World world=blockAccess.getBlockTileEntity(x,y,z) != null ? blockAccess.getBlockTileEntity(x,y,z).worldObj : null;
  ForgeDirection out=ForgeDirection.getOrientation(side);
  if (blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == myBlockId) {
    return null;
  }
  if (isEnergyHandler(world,x + out.offsetX,y + out.offsetY,z + out.offsetZ))   return glowIcons[getBlockType(blockAccess,x,y,z)][15];
  int iconIdx=0;
  for (int i=0; i < dirsToCheck.length; i++) {
    dir=dirsToCheck[i];
    if (blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == myBlockId || isEnergyHandler(world,x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ)) {
      iconIdx|=1 << i;
    }
  }
  return glowIcons[getBlockType(blockAccess,x,y,z)][iconIdx];
}