nus-yam/ex-repair huggingface dataset:
Program: 161293
Project: 161293
Buggy source:
public IndexedBedReader(File bedFile) throws IOException {
  this.source=bedFile;
  this.bedCodec=new BedLineCodec();
  if (bedFile == null)   throw new NullPointerException("String_Node_Str");
  if (!bedFile.isFile())   throw new IOException("String_Node_Str" + bedFile);
  if (!bedFile.canRead())   throw new IOException("String_Node_Str" + bedFile);
  this.reader=AbstractFeatureReader.getFeatureReader(bedFile.getPath(),bedCodec,false);
  File indexFile=Tribble.indexFile(this.source);
  if (indexFile.exists() && indexFile.lastModified() < bedFile.lastModified()) {
    LOG.info("String_Node_Str" + this.source);
    this.tribbleIndex=IndexFactory.loadIndex(indexFile.getPath());
  }
 else {
    LOG.info("String_Node_Str" + this.source + "String_Node_Str"+ indexFile);
    this.tribbleIndex=IndexFactory.createLinearIndex(bedFile,this.bedCodec);
  }
  this.reader=AbstractFeatureReader.getFeatureReader(bedFile.getPath(),this.bedCodec,this.tribbleIndex);
}

Fixed version (ground truth):
public IndexedBedReader(File bedFile) throws IOException {
  this.source=bedFile;
  if (bedFile == null)   throw new NullPointerException("String_Node_Str");
  if (!bedFile.isFile())   throw new IOException("String_Node_Str" + bedFile);
  if (!bedFile.canRead())   throw new IOException("String_Node_Str" + bedFile);
  if (bedFile.getName().endsWith("String_Node_Str")) {
    this.reader=new TabixReader(bedFile);
  }
 else {
    this.reader=new TribbleReader(bedFile);
  }
}
Program: 161294
Project: 161294
Buggy source:
public CloseableIterator<BedLine> iterator(String chrom,int start,int end) throws IOException {
  checkOpen();
  return this.reader.query(chrom,start,end);
}

Fixed version (ground truth):
@Override protected CloseableIterator<BedLine> iterator(Iterator<String> delegate){
  return new MyIterator(delegate);
}
Program: 161295
Project: 161295
Buggy source:
@Override public void close() throws IOException {
  CloserUtil.close(reader);
  this.reader=null;
  this.tribbleIndex=null;
}

Fixed version (ground truth):
@Override public void close(){
}
Program: 161297
Project: 161297
Buggy source:
private void failing(SAMRecord rec,SAMFileHeader h){
  openFailing(h);
  failingReadsWriter.addAlignment(rec);
}

Fixed version (ground truth):
private void failing(SAMRecord rec,SAMFileHeader h){
  openFailing(h);
  if (failingReadsWriter != null)   failingReadsWriter.addAlignment(rec);
}
Program: 161298
Project: 161298
Buggy source:
private void analyze(File f){
  LOG.debug("String_Node_Str" + f);
  if (f.isDirectory()) {
    for (    File c : f.listFiles()) {
      analyze(c);
    }
  }
 else {
    String name=f.getName();
    if (name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str")) {
      readBam(f);
    }
 else     if (name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str")) {
      readVCF(f);
    }
 else     if (name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str")|| name.endsWith("String_Node_Str")) {
      readFastq(f);
    }
  }
}

Fixed version (ground truth):
private void analyze(File f){
  if (f == null)   return;
  if (!f.canRead())   return;
  LOG.debug("String_Node_Str" + f);
  if (f.isDirectory()) {
    File children[]=f.listFiles();
    if (children == null)     return;
    for (    File c : f.listFiles()) {
      analyze(c);
    }
  }
 else {
    String name=f.getName();
    if (name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str")) {
      readBam(f);
    }
 else     if (name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str")) {
      readVCF(f);
    }
 else     if (name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str")|| name.endsWith("String_Node_Str")) {
      readFastq(f);
    }
  }
}
Program: 161299
Project: 161299
Buggy source:
@Override public String getBedName(){
  String fkey=this.gbFeature.getGBFeatureKey();
  TreeMap<QualKey,String> t=new TreeMap<QualKey,String>();
  for (  GBQualifier q : this.gbFeature.getGBFeatureQuals().getGBQualifier()) {
    String key=q.getGBQualifierName();
    for (    QualKey qk : QualKey.values()) {
      if (qk.name().equals(key)) {
        t.put(qk,q.getGBQualifierValue());
        break;
      }
    }
  }
  if (t.isEmpty()) {
    LOG.info("String_Node_Str" + fkey);
    if (!APPEND_ACN)     return fkey;
    return gbName() + "String_Node_Str" + fkey;
  }
  if (!APPEND_ACN)   return fkey + "String_Node_Str" + t.get(t.keySet().iterator().next());
  return gbName() + "String_Node_Str" + fkey+ "String_Node_Str"+ t.get(t.keySet().iterator().next());
}

Fixed version (ground truth):
@Override public String getBedName(){
  String fkey=this.gbFeature.getGBFeatureKey();
  TreeMap<QualKey,String> t=new TreeMap<QualKey,String>();
  if (this.gbFeature.getGBFeatureQuals() != null && this.gbFeature.getGBFeatureQuals().getGBQualifier() != null) {
    for (    GBQualifier q : this.gbFeature.getGBFeatureQuals().getGBQualifier()) {
      String key=q.getGBQualifierName();
      for (      QualKey qk : QualKey.values()) {
        if (qk.name().equals(key)) {
          t.put(qk,q.getGBQualifierValue());
          break;
        }
      }
    }
  }
  if (t.isEmpty()) {
    LOG.info("String_Node_Str" + fkey);
    if (!APPEND_ACN)     return fkey;
    return gbName() + "String_Node_Str" + fkey;
  }
  if (!APPEND_ACN)   return fkey + "String_Node_Str" + t.get(t.keySet().iterator().next());
  return gbName() + "String_Node_Str" + fkey+ "String_Node_Str"+ t.get(t.keySet().iterator().next());
}
Program: 161300
Project: 161300
Buggy source:
private void printUniprot(Uniprot uniprotSet){
  if (uniprotSet.getEntry().isEmpty()) {
    LOG.warn("String_Node_Str");
    return;
  }
  if (uniprotSet.getEntry().size() > 1) {
    LOG.warn("String_Node_Str");
  }
  for (  Entry entry : uniprotSet.getEntry()) {
    BlastOutputIterations iterations=this.blastOutput.getBlastOutputIterations();
    for (    Iteration iteration : iterations.getIteration()) {
      for (      FeatureType feature : entry.getFeature()) {
        if (!this.FK.isEmpty()) {
          if (!FK.contains(feature.getType())) {
            continue;
          }
        }
        for (        Hit hit : iteration.getIterationHits().getHit()) {
          for (          Hsp hsp : hit.getHitHsps().getHsp()) {
            UniprotInterval bi=new UniprotInterval();
            bi.entry=entry;
            bi.featureType=feature;
            bi.hit=hit;
            bi.hsp=hsp;
            LOG.info("String_Node_Str" + bi);
            if (!bi.isFeatureOverlapHsp()) {
              continue;
            }
            System.out.println(bi.toBedString());
          }
        }
      }
      break;
    }
    break;
  }
}

Fixed version (ground truth):
private void printUniprot(Uniprot uniprotSet){
  if (uniprotSet.getEntry().isEmpty()) {
    LOG.warn("String_Node_Str");
    return;
  }
  if (uniprotSet.getEntry().size() > 1) {
    LOG.warn("String_Node_Str");
  }
  for (  Entry entry : uniprotSet.getEntry()) {
    BlastOutputIterations iterations=this.blastOutput.getBlastOutputIterations();
    for (    Iteration iteration : iterations.getIteration()) {
      for (      FeatureType feature : entry.getFeature()) {
        if (!this.FK.isEmpty()) {
          if (!FK.contains(feature.getType())) {
            continue;
          }
        }
        for (        Hit hit : iteration.getIterationHits().getHit()) {
          for (          Hsp hsp : hit.getHitHsps().getHsp()) {
            UniprotInterval bi=new UniprotInterval();
            bi.entry=entry;
            bi.featureType=feature;
            bi.hit=hit;
            bi.hsp=hsp;
            LOG.debug("String_Node_Str" + bi);
            if (!bi.isFeatureOverlapHsp()) {
              continue;
            }
            System.out.println(bi.toBedString());
          }
        }
      }
      break;
    }
    break;
  }
}
Program: 161301
Project: 161301
Buggy source:
private void printGB(GBSet gbSet){
  for (  GBSeq gbSeq : gbSet.getGBSeq()) {
    BlastOutputIterations iterations=this.blastOutput.getBlastOutputIterations();
    for (    Iteration iteration : iterations.getIteration()) {
      for (      GBFeature feature : gbSeq.getGBSeqFeatureTable().getGBFeature()) {
        if (feature.getGBFeatureIntervals() == null)         continue;
        if (!this.FK.isEmpty()) {
          if (!FK.contains(feature.getGBFeatureKey())) {
            continue;
          }
        }
        for (        GBInterval interval : feature.getGBFeatureIntervals().getGBInterval()) {
          for (          Hit hit : iteration.getIterationHits().getHit()) {
            for (            Hsp hsp : hit.getHitHsps().getHsp()) {
              GenbankInterval bi=new GenbankInterval();
              bi.gbSeq=gbSeq;
              bi.gbFeature=feature;
              bi.gbInterval=interval;
              bi.hit=hit;
              bi.hsp=hsp;
              LOG.info("String_Node_Str" + bi);
              if (!bi.isGbForward())               LOG.info("String_Node_Str");
              if (!bi.isFeatureOverlapHsp())               continue;
              System.out.println(bi.toBedString());
            }
          }
        }
      }
      break;
    }
  }
}

Fixed version (ground truth):
private void printGB(GBSet gbSet){
  for (  GBSeq gbSeq : gbSet.getGBSeq()) {
    BlastOutputIterations iterations=this.blastOutput.getBlastOutputIterations();
    for (    Iteration iteration : iterations.getIteration()) {
      for (      GBFeature feature : gbSeq.getGBSeqFeatureTable().getGBFeature()) {
        if (feature.getGBFeatureIntervals() == null)         continue;
        if (!this.FK.isEmpty()) {
          if (!FK.contains(feature.getGBFeatureKey())) {
            continue;
          }
        }
        for (        GBInterval interval : feature.getGBFeatureIntervals().getGBInterval()) {
          for (          Hit hit : iteration.getIterationHits().getHit()) {
            for (            Hsp hsp : hit.getHitHsps().getHsp()) {
              GenbankInterval bi=new GenbankInterval();
              bi.gbSeq=gbSeq;
              bi.gbFeature=feature;
              bi.gbInterval=interval;
              bi.hit=hit;
              bi.hsp=hsp;
              LOG.debug("String_Node_Str" + bi);
              if (!bi.isGbForward())               LOG.info("String_Node_Str");
              if (!bi.isFeatureOverlapHsp())               continue;
              System.out.println(bi.toBedString());
            }
          }
        }
      }
      break;
    }
  }
}
Program: 161302
Project: 161302
Buggy source:
public int maxPoints(Point[] points){
  Map<Double,Integer> map=new HashMap<Double,Integer>();
  int ret=0;
  int size=points.length;
  for (int i=0; i < size; i++) {
    int invalidK=0;
    int add=1;
    for (int j=i + 1; j < size; j++) {
      if (points[j].x == points[i].x) {
        if (points[j].y == points[i].y) {
          add++;
        }
 else {
          invalidK++;
        }
        continue;
      }
      double k=points[j].y == points[i].y ? 0.0 : (1.0 * (points[j].y - points[i].y)) / (points[j].x - points[i].x);
      if (map.containsKey(k)) {
        int count=map.get(k);
        map.put(k,count + 1);
      }
 else {
        map.put(k,1);
      }
    }
    for (    Integer it : map.values()) {
      if (it + add > ret) {
        ret=it.intValue() + add;
      }
    }
    ret=Math.max(invalidK + add,ret);
    map.clear();
  }
  return ret;
}

Fixed version (ground truth):
public int maxPoints(Point[] points){
  Map<Line,Integer> map=new HashMap<Line,Integer>();
  int ret=0;
  int size=points.length;
  for (int i=0; i < size; i++) {
    int dup=0;
    for (int j=i + 1; j < size; j++) {
      Line line=null;
      if (points[j].x == points[i].x) {
        if (points[j].y == points[i].y) {
          dup++;
          continue;
        }
        line=new Line(Double.MAX_VALUE,Double.MAX_VALUE);
      }
 else {
        double slope=points[j].y == points[i].y ? 0.0 : (1.0 * (points[j].y - points[i].y)) / (points[j].x - points[i].x);
        double intercept=points[i].y - slope * points[i].x;
        line=new Line(slope,intercept);
      }
      if (map.containsKey(line)) {
        map.put(line,map.get(line) + 1);
      }
 else {
        map.put(line,2);
      }
    }
    for (    Integer count : map.values()) {
      ret=Math.max(ret,count.intValue() + dup);
    }
    map.clear();
  }
  return ret > 0 ? ret : points.length;
}
Program: 161304
Project: 161304
Buggy source:
@Override public Class<?> loadClass(String name) throws ClassNotFoundException {
  for (  String blacklistedPackage : getPackagesToLoadViaStandardClassloader()) {
    if (name.startsWith(blacklistedPackage)) {
      return GwtMockitoTestRunner.class.getClassLoader().loadClass(name);
    }
  }
  return super.loadClass(name);
}

Fixed version (ground truth):
@Override protected Class<?> loadClass(String name,boolean resolve) throws ClassNotFoundException {
  for (  String blacklistedPackage : getPackagesToLoadViaStandardClassloader()) {
    if (name.startsWith(blacklistedPackage)) {
      Class<?> clazz=GwtMockitoTestRunner.class.getClassLoader().loadClass(name);
      if (resolve) {
        resolveClass(clazz);
      }
      return clazz;
    }
  }
  return super.loadClass(name,resolve);
}
Program: 161306
Project: 161306
Buggy source:
private String makeNullParameters(int count){
  if (count == 0) {
    return "String_Node_Str";
  }
  StringBuilder params=new StringBuilder();
  for (int i=0; i < count; i++) {
    params.append("String_Node_Str");
  }
  return params.substring(1).toString();
}

Fixed version (ground truth):
private String makeNullParameters(CtClass[] paramClasses){
  if (paramClasses.length == 0) {
    return "String_Node_Str";
  }
  StringBuilder params=new StringBuilder();
  for (  CtClass paramClass : paramClasses) {
    params.append("String_Node_Str");
    String className=paramClass.getName();
    if (className.equals("String_Node_Str")) {
      params.append("String_Node_Str");
    }
 else     if (className.equals("String_Node_Str")) {
      params.append("String_Node_Str");
    }
 else     if (className.equals("String_Node_Str")) {
      params.append("String_Node_Str");
    }
 else     if (className.equals("String_Node_Str")) {
      params.append("String_Node_Str");
    }
 else     if (className.equals("String_Node_Str")) {
      params.append("String_Node_Str");
    }
 else     if (className.equals("String_Node_Str")) {
      params.append("String_Node_Str");
    }
 else     if (className.equals("String_Node_Str")) {
      params.append("String_Node_Str");
    }
 else     if (className.equals("String_Node_Str")) {
      params.append("String_Node_Str");
    }
 else {
      params.append("String_Node_Str");
    }
  }
  return params.substring(1).toString();
}
Program: 161308
Project: 161308
Buggy source:
/** 
 * Creates a test runner which allows final GWT classes to be mocked. Works by reloading the test class using a custom classloader and substituting the reference.
 */
public GwtMockitoTestRunner(Class<?> unitTestClass) throws InitializationError {
  super(unitTestClass);
  this.unitTestClass=unitTestClass;
  ClassPool classPool=new ClassPool();
  classPool.appendSystemPath();
  for (  String path : getAdditionalClasspaths()) {
    try {
      classPool.appendClassPath(path);
    }
 catch (    NotFoundException e) {
      throw new IllegalStateException("String_Node_Str" + path,e);
    }
  }
  gwtMockitoClassLoader=new GwtMockitoClassLoader(getParentClassloader(),classPool);
  ClassLoader originalClassLoader=Thread.currentThread().getContextClassLoader();
  Thread.currentThread().setContextClassLoader(gwtMockitoClassLoader);
  try {
    Class<?> customLoadedTestClass=gwtMockitoClassLoader.loadClass(unitTestClass.getName());
    customLoadedGwtMockito=gwtMockitoClassLoader.loadClass(GwtMockito.class.getName());
    Field testClassField=ParentRunner.class.getDeclaredField("String_Node_Str");
    testClassField.setAccessible(true);
    testClassField.set(this,new TestClass(customLoadedTestClass));
  }
 catch (  Exception e) {
    throw new InitializationError(e);
  }
 finally {
    Thread.currentThread().setContextClassLoader(originalClassLoader);
  }
}

Fixed version (ground truth):
/** 
 * Creates a test runner which allows final GWT classes to be mocked. Works by reloading the test class using a custom classloader and substituting the reference.
 */
public GwtMockitoTestRunner(Class<?> unitTestClass) throws InitializationError {
  super(unitTestClass);
  this.unitTestClass=unitTestClass;
  ClassPool classPool=new ClassPool();
  classPool.appendSystemPath();
  for (  String path : getAdditionalClasspaths()) {
    try {
      classPool.appendClassPath(path);
    }
 catch (    NotFoundException e) {
      throw new IllegalStateException("String_Node_Str" + path,e);
    }
  }
  gwtMockitoClassLoader=new GwtMockitoClassLoader(getParentClassloader(),classPool);
  ClassLoader originalClassLoader=Thread.currentThread().getContextClassLoader();
  Thread.currentThread().setContextClassLoader(gwtMockitoClassLoader);
  try {
    Class<?> customLoadedTestClass=gwtMockitoClassLoader.loadClass(unitTestClass.getName());
    customLoadedGwtMockito=gwtMockitoClassLoader.loadClass(GwtMockito.class.getName());
    Field testClassField;
    try {
      testClassField=ParentRunner.class.getDeclaredField("String_Node_Str");
    }
 catch (    NoSuchFieldException e) {
      testClassField=ParentRunner.class.getDeclaredField("String_Node_Str");
    }
    testClassField.setAccessible(true);
    testClassField.set(this,new TestClass(customLoadedTestClass));
  }
 catch (  Exception e) {
    throw new InitializationError(e);
  }
 finally {
    Thread.currentThread().setContextClassLoader(originalClassLoader);
  }
}
Program: 161309
Project: 161309
Buggy source:
@Override public Void answer(InvocationOnMock invocation){
  for (  Object arg : invocation.getArguments()) {
    if (arg instanceof AsyncCallback<?>) {
      ((AsyncCallback<?>)invocation.getArguments()[1]).onFailure(result);
      return null;
    }
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Void answer(InvocationOnMock invocation){
  for (  Object arg : invocation.getArguments()) {
    if (arg instanceof AsyncCallback<?>) {
      ((AsyncCallback<?>)arg).onFailure(result);
      return null;
    }
  }
  throw new IllegalStateException("String_Node_Str");
}
Program: 161310
Project: 161310
Buggy source:
/** 
 * Invokes   {@link AsyncCallback#onSuccess} on the first argument of type {@link AsyncCallback}passed to the method. The method must take an   {@link AsyncCallback} parameter of theappropriate type.
 * @param result argument to pass to onSuccess
 * @return an answer that invokes onSuccess with the given argument
 */
public static <T>Answer<Void> returnSuccess(final T result){
  return new Answer<Void>(){
    @Override @SuppressWarnings("String_Node_Str") public Void answer(    InvocationOnMock invocation){
      for (      Object arg : invocation.getArguments()) {
        if (arg instanceof AsyncCallback<?>) {
          ((AsyncCallback<T>)invocation.getArguments()[1]).onSuccess(result);
          return null;
        }
      }
      throw new IllegalStateException("String_Node_Str");
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Invokes   {@link AsyncCallback#onSuccess} on the first argument of type {@link AsyncCallback}passed to the method. The method must take an   {@link AsyncCallback} parameter of theappropriate type.
 * @param result argument to pass to onSuccess
 * @return an answer that invokes onSuccess with the given argument
 */
public static <T>Answer<Void> returnSuccess(final T result){
  return new Answer<Void>(){
    @Override @SuppressWarnings("String_Node_Str") public Void answer(    InvocationOnMock invocation){
      for (      Object arg : invocation.getArguments()) {
        if (arg instanceof AsyncCallback<?>) {
          ((AsyncCallback<T>)arg).onSuccess(result);
          return null;
        }
      }
      throw new IllegalStateException("String_Node_Str");
    }
  }
;
}
Program: 161311
Project: 161311
Buggy source:
/** 
 * Invokes   {@link AsyncCallback#onFailure} on the first argument of type {@link AsyncCallback}passed to the method. The method must take an   {@link AsyncCallback} parameter of theappropriate type.
 * @param result argument to pass to onFailure
 * @return an answer that invokes onFailure with the given argument
 */
public static Answer<Void> returnFailure(final Throwable result){
  return new Answer<Void>(){
    @Override public Void answer(    InvocationOnMock invocation){
      for (      Object arg : invocation.getArguments()) {
        if (arg instanceof AsyncCallback<?>) {
          ((AsyncCallback<?>)invocation.getArguments()[1]).onFailure(result);
          return null;
        }
      }
      throw new IllegalStateException("String_Node_Str");
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Invokes   {@link AsyncCallback#onFailure} on the first argument of type {@link AsyncCallback}passed to the method. The method must take an   {@link AsyncCallback} parameter of theappropriate type.
 * @param result argument to pass to onFailure
 * @return an answer that invokes onFailure with the given argument
 */
public static Answer<Void> returnFailure(final Throwable result){
  return new Answer<Void>(){
    @Override public Void answer(    InvocationOnMock invocation){
      for (      Object arg : invocation.getArguments()) {
        if (arg instanceof AsyncCallback<?>) {
          ((AsyncCallback<?>)arg).onFailure(result);
          return null;
        }
      }
      throw new IllegalStateException("String_Node_Str");
    }
  }
;
}
Program: 161314
Project: 161314
Buggy source:
@Override public void initGui(){
  super.initGui();
  int leftX=guiLeft + 8;
  int topY=guiTop + 6;
  titleString=new BeefGuiLabel(this,_entity.getInventoryName(),leftX,topY);
  topY+=titleString.getHeight() + 8;
  fluidBar=new BeefGuiFluidBar(this,guiLeft + 8,guiTop + 16,_entity,0);
  powerBar=new BeefGuiPowerBar(this,guiLeft + 148,guiTop + 16,_entity);
  progressArrow=new BeefGuiProgressArrow(this,guiLeft + 76,guiTop + 41,0,178,_entity);
  registerControl(titleString);
  registerControl(powerBar);
  registerControl(fluidBar);
  registerControl(progressArrow);
  createInventoryExposureButtons(guiLeft + 180,guiTop + 4);
}

Fixed version (ground truth):
@Override public void initGui(){
  super.initGui();
  titleString=new BeefGuiLabel(this,_entity.getInventoryName(),guiLeft + 8,guiTop + 6);
  fluidBar=new BeefGuiFluidBar(this,guiLeft + 8,guiTop + 16,_entity,0);
  powerBar=new BeefGuiPowerBar(this,guiLeft + 148,guiTop + 16,_entity);
  progressArrow=new BeefGuiProgressArrow(this,guiLeft + 76,guiTop + 41,0,178,_entity);
  registerControl(titleString);
  registerControl(powerBar);
  registerControl(fluidBar);
  registerControl(progressArrow);
  createInventoryExposureButtons(guiLeft + 180,guiTop + 4);
}
Program: 161316
Project: 161316
Buggy source:
public void onChannelChanged(int changedChannel){
  if (this.selectedChannel != changedChannel) {
    return;
  }
  CoordTriplet[] controlRodLocations=port.getReactorController().getControlRodLocations();
  CircuitType currentCircuitType=grabTargets[selectedChannel].getCircuitType();
  if (CircuitType.hasCoordinate(currentCircuitType)) {
    subSettingString.setLabelText("String_Node_Str");
    subSettingForwardBtn.visible=true;
    subSettingBackBtn.visible=true;
  }
 else   if (TileEntityReactorRedNetPort.isInput(currentCircuitType) && CircuitType.canBeToggledBetweenPulseAndNormal(currentCircuitType)) {
    subSettingString.setLabelText("String_Node_Str");
    subSettingForwardBtn.visible=true;
    subSettingBackBtn.visible=true;
  }
 else   if (currentCircuitType == CircuitType.inputEjectWaste) {
    subSettingString.setLabelText("String_Node_Str");
    subSettingForwardBtn.visible=false;
    subSettingBackBtn.visible=false;
  }
 else {
    subSettingString.setLabelText("String_Node_Str");
    subSettingForwardBtn.visible=false;
    subSettingBackBtn.visible=false;
  }
  updateSubSettingValueText();
}

Fixed version (ground truth):
public void onChannelChanged(int changedChannel){
  if (this.selectedChannel != changedChannel) {
    return;
  }
  CircuitType currentCircuitType=grabTargets[selectedChannel].getCircuitType();
  if (CircuitType.hasCoordinate(currentCircuitType)) {
    subSettingString.setLabelText("String_Node_Str");
    subSettingForwardBtn.visible=true;
    subSettingBackBtn.visible=true;
  }
 else   if (TileEntityReactorRedNetPort.isInput(currentCircuitType) && CircuitType.canBeToggledBetweenPulseAndNormal(currentCircuitType)) {
    subSettingString.setLabelText("String_Node_Str");
    subSettingForwardBtn.visible=true;
    subSettingBackBtn.visible=true;
  }
 else   if (currentCircuitType == CircuitType.inputEjectWaste) {
    subSettingString.setLabelText("String_Node_Str");
    subSettingForwardBtn.visible=false;
    subSettingBackBtn.visible=false;
  }
 else {
    subSettingString.setLabelText("String_Node_Str");
    subSettingForwardBtn.visible=false;
    subSettingBackBtn.visible=false;
  }
  updateSubSettingValueText();
}
Program: 161317
Project: 161317
Buggy source:
private void validateInputValues(){
  outputLevel=0;
  String in1=this.subInputRodSetting.getText();
  int val1;
  if (in1.isEmpty()) {
    val1=0;
  }
 else {
    val1=Integer.valueOf(in1);
    if (val1 < 0) {
      val1=0;
    }
 else     if (val1 > 100) {
      val1=100;
    }
  }
  this.subInputRodSetting.setText(Integer.toString(val1));
  if (this.subInputRodSettingOff.getVisible()) {
    int val2;
    String in2=this.subInputRodSettingOff.getText();
    if (in2.isEmpty()) {
      val2=0;
    }
 else {
      val2=Integer.valueOf(in2);
      if (val2 < 0) {
        val2=0;
      }
 else       if (val2 > 100) {
        val2=100;
      }
    }
    this.outputLevel=(val2 << 8) & 0xFF00;
    this.subInputRodSettingOff.setText(Integer.toString(val2));
  }
 else {
    this.outputLevel=this.outputLevel & 0xFF00;
  }
  this.outputLevel|=val1 & 0xFF;
}

Fixed version (ground truth):
private void validateInputValues(){
  outputLevel=0;
  String in1=this.subInputRodSetting.getText();
  int val1;
  if (in1.isEmpty()) {
    val1=0;
  }
 else {
    val1=Integer.parseInt(in1);
    if (val1 < 0) {
      val1=0;
    }
 else     if (val1 > 100) {
      val1=100;
    }
  }
  this.subInputRodSetting.setText(Integer.toString(val1));
  if (this.subInputRodSettingOff.getVisible()) {
    int val2;
    String in2=this.subInputRodSettingOff.getText();
    if (in2.isEmpty()) {
      val2=0;
    }
 else {
      val2=Integer.parseInt(in2);
      if (val2 < 0) {
        val2=0;
      }
 else       if (val2 > 100) {
        val2=100;
      }
    }
    this.outputLevel=(val2 << 8) & 0xFF00;
    this.subInputRodSettingOff.setText(Integer.toString(val2));
  }
 else {
    this.outputLevel=this.outputLevel & 0xFF00;
  }
  this.outputLevel|=val1 & 0xFF;
}
Program: 161318
Project: 161318
Buggy source:
private void validateOutputValues(){
  CircuitType selectedType=getUserSelectedCircuitType();
  int maxVal=Integer.MAX_VALUE;
  if (selectedType == CircuitType.outputFuelMix || selectedType == CircuitType.outputEnergyAmount) {
    maxVal=100;
  }
  String in1=this.subOutputValue.getText();
  int val1;
  if (in1.isEmpty()) {
    val1=0;
  }
 else {
    val1=Integer.valueOf(in1);
    if (val1 < 0) {
      val1=0;
    }
 else     if (val1 > maxVal) {
      val1=maxVal;
    }
  }
  this.subOutputValue.setText(Integer.toString(val1));
  this.outputLevel=val1;
}

Fixed version (ground truth):
private void validateOutputValues(){
  CircuitType selectedType=getUserSelectedCircuitType();
  int maxVal=Integer.MAX_VALUE;
  if (selectedType == CircuitType.outputFuelMix || selectedType == CircuitType.outputEnergyAmount) {
    maxVal=100;
  }
  String in1=this.subOutputValue.getText();
  int val1;
  if (in1.isEmpty()) {
    val1=0;
  }
 else {
    val1=Integer.parseInt(in1);
    if (val1 < 0) {
      val1=0;
    }
 else     if (val1 > maxVal) {
      val1=maxVal;
    }
  }
  this.subOutputValue.setText(Integer.toString(val1));
  this.outputLevel=val1;
}
Program: 161319
Project: 161319
Buggy source:
@Override protected void actionPerformed(GuiButton button){
  CoordTriplet saveDelegate=reactor.getReferenceCoord();
  if (button.id == 0 || button.id == 1) {
    boolean newSetting=button.id == 0;
    if (newSetting != reactor.getActive()) {
      CommonPacketHandler.INSTANCE.sendToServer(new MachineCommandActivateMessage(reactor,newSetting));
    }
  }
 else   if (button.id >= 2 && button.id <= 4) {
    WasteEjectionSetting newEjectionSetting;
switch (button.id) {
case 4:
      newEjectionSetting=WasteEjectionSetting.kManual;
    break;
default :
  newEjectionSetting=WasteEjectionSetting.kAutomatic;
break;
}
if (reactor.getWasteEjection() != newEjectionSetting) {
CommonPacketHandler.INSTANCE.sendToServer(new ReactorChangeWasteEjectionMessage(reactor,newEjectionSetting));
}
}
 else if (button.id == 5) {
CommonPacketHandler.INSTANCE.sendToServer(new ReactorCommandEjectMessage(reactor,false,isShiftKeyDown()));
}
}

Fixed version (ground truth):
@Override protected void actionPerformed(GuiButton button){
  if (button.id == 0 || button.id == 1) {
    boolean newSetting=button.id == 0;
    if (newSetting != reactor.getActive()) {
      CommonPacketHandler.INSTANCE.sendToServer(new MachineCommandActivateMessage(reactor,newSetting));
    }
  }
 else   if (button.id >= 2 && button.id <= 4) {
    WasteEjectionSetting newEjectionSetting;
switch (button.id) {
case 4:
      newEjectionSetting=WasteEjectionSetting.kManual;
    break;
default :
  newEjectionSetting=WasteEjectionSetting.kAutomatic;
break;
}
if (reactor.getWasteEjection() != newEjectionSetting) {
CommonPacketHandler.INSTANCE.sendToServer(new ReactorChangeWasteEjectionMessage(reactor,newEjectionSetting));
}
}
 else if (button.id == 5) {
CommonPacketHandler.INSTANCE.sendToServer(new ReactorCommandEjectMessage(reactor,false,isShiftKeyDown()));
}
}
Program: 161321
Project: 161321
Buggy source:
@Override protected void actionPerformed(GuiButton button){
  CoordTriplet saveDelegate=turbine.getReferenceCoord();
  if (button.id == 0 || button.id == 1) {
    boolean setActive=button.id == 0;
    if (setActive != turbine.getActive()) {
      CommonPacketHandler.INSTANCE.sendToServer(new MachineCommandActivateMessage(turbine,setActive));
    }
  }
  if (button.id == 2 || button.id == 3) {
    int exponent=0;
    if (isShiftKeyDown()) {
      exponent+=1;
    }
    if (isCtrlKeyDown()) {
      exponent+=2;
    }
    int newMax=(int)Math.round(Math.pow(10,exponent));
    if (button.id == 3) {
      newMax*=-1;
    }
    newMax=Math.max(0,Math.min(turbine.getMaxIntakeRateMax(),turbine.getMaxIntakeRate() + newMax));
    if (newMax != turbine.getMaxIntakeRate()) {
      CommonPacketHandler.INSTANCE.sendToServer(new TurbineChangeMaxIntakeMessage(turbine,newMax));
    }
  }
  if (button.id >= 4 && button.id <= 6) {
    VentStatus newStatus;
switch (button.id) {
case 5:
      newStatus=VentStatus.VentOverflow;
    break;
case 6:
  newStatus=VentStatus.DoNotVent;
break;
default :
newStatus=VentStatus.VentAll;
break;
}
if (newStatus != turbine.getVentSetting()) {
CommonPacketHandler.INSTANCE.sendToServer(new TurbineChangeVentMessage(turbine,newStatus));
}
}
if (button.id == 7 || button.id == 8) {
boolean newStatus=button.id == 7;
if (newStatus != turbine.getInductorEngaged()) {
CommonPacketHandler.INSTANCE.sendToServer(new TurbineChangeInductorMessage(turbine,newStatus));
}
}
}

Fixed version (ground truth):
@Override protected void actionPerformed(GuiButton button){
  if (button.id == 0 || button.id == 1) {
    boolean setActive=button.id == 0;
    if (setActive != turbine.getActive()) {
      CommonPacketHandler.INSTANCE.sendToServer(new MachineCommandActivateMessage(turbine,setActive));
    }
  }
  if (button.id == 2 || button.id == 3) {
    int exponent=0;
    if (isShiftKeyDown()) {
      exponent+=1;
    }
    if (isCtrlKeyDown()) {
      exponent+=2;
    }
    int newMax=(int)Math.round(Math.pow(10,exponent));
    if (button.id == 3) {
      newMax*=-1;
    }
    newMax=Math.max(0,Math.min(turbine.getMaxIntakeRateMax(),turbine.getMaxIntakeRate() + newMax));
    if (newMax != turbine.getMaxIntakeRate()) {
      CommonPacketHandler.INSTANCE.sendToServer(new TurbineChangeMaxIntakeMessage(turbine,newMax));
    }
  }
  if (button.id >= 4 && button.id <= 6) {
    VentStatus newStatus;
switch (button.id) {
case 5:
      newStatus=VentStatus.VentOverflow;
    break;
case 6:
  newStatus=VentStatus.DoNotVent;
break;
default :
newStatus=VentStatus.VentAll;
break;
}
if (newStatus != turbine.getVentSetting()) {
CommonPacketHandler.INSTANCE.sendToServer(new TurbineChangeVentMessage(turbine,newStatus));
}
}
if (button.id == 7 || button.id == 8) {
boolean newStatus=button.id == 7;
if (newStatus != turbine.getInductorEngaged()) {
CommonPacketHandler.INSTANCE.sendToServer(new TurbineChangeInductorMessage(turbine,newStatus));
}
}
}
Program: 161324
Project: 161324
Buggy source:
public void changeAllControlRodInsertionValues(short delta){
  if (this.assemblyState != AssemblyState.Assembled) {
    return;
  }
  for (  TileEntityReactorControlRod cr : attachedControlRods) {
    if (cr != null && cr.isConnected()) {
      cr.setControlRodInsertion((short)(cr.getControlRodInsertion() + delta));
    }
  }
}

Fixed version (ground truth):
public void changeAllControlRodInsertionValues(short delta){
  if (this.assemblyState != AssemblyState.Assembled) {
    return;
  }
  for (  TileEntityReactorControlRod cr : attachedControlRods) {
    if (cr.isConnected()) {
      cr.setControlRodInsertion((short)(cr.getControlRodInsertion() + delta));
    }
  }
}
Program: 161325
Project: 161325
Buggy source:
/** 
 * Eject fuel contained in the reactor.
 * @param dumpAll If true, any remaining fuel will simply be lost.
 * @param destination If not null, then fuel will only be distributed to a port matching these coordinates.
 */
public void ejectFuel(boolean dumpAll,CoordTriplet destination){
  int amtEjected=0;
  String fuelReactantType=fuelContainer.getFuelType();
  if (fuelReactantType == null) {
    return;
  }
  int minimumReactantAmount=Reactants.getMinimumReactantToProduceSolid(fuelReactantType);
  if (fuelContainer.getFuelAmount() >= minimumReactantAmount) {
    for (    TileEntityReactorAccessPort port : attachedAccessPorts) {
      if (fuelContainer.getFuelAmount() < minimumReactantAmount) {
        continue;
      }
      if (port == null || !port.isConnected()) {
        continue;
      }
      if (destination != null && !destination.equals(port.xCoord,port.yCoord,port.zCoord)) {
        continue;
      }
      int reactantEjected=port.emitReactant(fuelReactantType,fuelContainer.getFuelAmount());
      fuelContainer.dumpFuel(reactantEjected);
      amtEjected+=reactantEjected;
    }
  }
  if (dumpAll) {
    amtEjected+=fuelContainer.getFuelAmount();
    fuelContainer.setFuel(null);
  }
  if (amtEjected > 0) {
    markReferenceCoordForUpdate();
    markReferenceCoordDirty();
  }
}

Fixed version (ground truth):
/** 
 * Eject fuel contained in the reactor.
 * @param dumpAll If true, any remaining fuel will simply be lost.
 * @param destination If not null, then fuel will only be distributed to a port matching these coordinates.
 */
public void ejectFuel(boolean dumpAll,CoordTriplet destination){
  int amtEjected=0;
  String fuelReactantType=fuelContainer.getFuelType();
  if (fuelReactantType == null) {
    return;
  }
  int minimumReactantAmount=Reactants.getMinimumReactantToProduceSolid(fuelReactantType);
  if (fuelContainer.getFuelAmount() >= minimumReactantAmount) {
    for (    TileEntityReactorAccessPort port : attachedAccessPorts) {
      if (fuelContainer.getFuelAmount() < minimumReactantAmount) {
        continue;
      }
      if (!port.isConnected()) {
        continue;
      }
      if (destination != null && !destination.equals(port.xCoord,port.yCoord,port.zCoord)) {
        continue;
      }
      int reactantEjected=port.emitReactant(fuelReactantType,fuelContainer.getFuelAmount());
      fuelContainer.dumpFuel(reactantEjected);
      amtEjected+=reactantEjected;
    }
  }
  if (dumpAll) {
    amtEjected+=fuelContainer.getFuelAmount();
    fuelContainer.setFuel(null);
  }
  if (amtEjected > 0) {
    markReferenceCoordForUpdate();
    markReferenceCoordDirty();
  }
}
Program: 161326
Project: 161326
Buggy source:
protected void refuel(){
  if (fuelContainer.getRemainingSpace() < Reactants.standardSolidReactantAmount) {
    return;
  }
  int amtAdded=0;
  for (  TileEntityReactorAccessPort port : attachedAccessPorts) {
    if (fuelContainer.getRemainingSpace() <= 0) {
      break;
    }
    if (port == null || !port.isConnected()) {
      continue;
    }
    String portReactantType=port.getInputReactantType();
    int portReactantAmount=port.getInputReactantAmount();
    if (portReactantType == null || portReactantAmount <= 0) {
      continue;
    }
    if (!Reactants.isFuel(portReactantType)) {
      continue;
    }
    int amountToAdd=fuelContainer.addFuel(portReactantType,portReactantAmount,false);
    if (amountToAdd <= 0) {
      continue;
    }
    int portCanAdd=port.consumeReactantItem(amountToAdd);
    if (portCanAdd <= 0) {
      continue;
    }
    amtAdded=fuelContainer.addFuel(portReactantType,portReactantAmount,true);
  }
  if (amtAdded > 0) {
    markReferenceCoordForUpdate();
    markReferenceCoordDirty();
  }
}

Fixed version (ground truth):
protected void refuel(){
  if (fuelContainer.getRemainingSpace() < Reactants.standardSolidReactantAmount) {
    return;
  }
  int amtAdded=0;
  for (  TileEntityReactorAccessPort port : attachedAccessPorts) {
    if (fuelContainer.getRemainingSpace() <= 0) {
      break;
    }
    if (!port.isConnected()) {
      continue;
    }
    String portReactantType=port.getInputReactantType();
    int portReactantAmount=port.getInputReactantAmount();
    if (portReactantType == null || portReactantAmount <= 0) {
      continue;
    }
    if (!Reactants.isFuel(portReactantType)) {
      continue;
    }
    int amountToAdd=fuelContainer.addFuel(portReactantType,portReactantAmount,false);
    if (amountToAdd <= 0) {
      continue;
    }
    int portCanAdd=port.consumeReactantItem(amountToAdd);
    if (portCanAdd <= 0) {
      continue;
    }
    amtAdded=fuelContainer.addFuel(portReactantType,portReactantAmount,true);
  }
  if (amtAdded > 0) {
    markReferenceCoordForUpdate();
    markReferenceCoordDirty();
  }
}
Program: 161329
Project: 161329
Buggy source:
private void recalculateDerivedValues(){
  CoordTriplet minCoord, maxCoord;
  minCoord=getMinimumCoord();
  maxCoord=getMaximumCoord();
  fuelContainer.setCapacity(attachedFuelRods.size() * FuelCapacityPerFuelRod);
  fuelToReactorHeatTransferCoefficient=0f;
  for (  TileEntityReactorFuelRod fuelRod : attachedFuelRods) {
    fuelToReactorHeatTransferCoefficient+=fuelRod.getHeatTransferRate();
  }
  int maxFuelRodY=maxCoord.y - 1;
  int minFuelRodY=minCoord.y + 1;
  currentFuelRod=attachedFuelRods.iterator();
  int xSize=maxCoord.x - minCoord.x - 1;
  int ySize=maxCoord.y - minCoord.y - 1;
  int zSize=maxCoord.z - minCoord.z - 1;
  int surfaceArea=2 * (xSize * ySize + xSize * zSize + ySize * zSize);
  reactorToCoolantSystemHeatTransferCoefficient=IHeatEntity.conductivityIron * surfaceArea;
  xSize+=2;
  ySize+=2;
  zSize+=2;
  surfaceArea=2 * (xSize * ySize + xSize * zSize + ySize * zSize);
  reactorHeatLossCoefficient=reactorHeatLossConductivity * surfaceArea;
  if (worldObj.isRemote) {
    this.onFuelStatusChanged();
  }
 else {
    markReferenceCoordForUpdate();
  }
  calculateReactorVolume();
  if (attachedCoolantPorts.size() > 0) {
    int outerVolume=StaticUtils.ExtraMath.Volume(minCoord,maxCoord) - reactorVolume;
    coolantContainer.setCapacity(Math.max(0,Math.min(50000,outerVolume * 100)));
  }
 else {
    coolantContainer.setCapacity(0);
  }
}

Fixed version (ground truth):
private void recalculateDerivedValues(){
  CoordTriplet minCoord, maxCoord;
  minCoord=getMinimumCoord();
  maxCoord=getMaximumCoord();
  fuelContainer.setCapacity(attachedFuelRods.size() * FuelCapacityPerFuelRod);
  fuelToReactorHeatTransferCoefficient=0f;
  for (  TileEntityReactorFuelRod fuelRod : attachedFuelRods) {
    fuelToReactorHeatTransferCoefficient+=fuelRod.getHeatTransferRate();
  }
  int xSize=maxCoord.x - minCoord.x - 1;
  int ySize=maxCoord.y - minCoord.y - 1;
  int zSize=maxCoord.z - minCoord.z - 1;
  int surfaceArea=2 * (xSize * ySize + xSize * zSize + ySize * zSize);
  reactorToCoolantSystemHeatTransferCoefficient=IHeatEntity.conductivityIron * surfaceArea;
  xSize+=2;
  ySize+=2;
  zSize+=2;
  surfaceArea=2 * (xSize * ySize + xSize * zSize + ySize * zSize);
  reactorHeatLossCoefficient=reactorHeatLossConductivity * surfaceArea;
  if (worldObj.isRemote) {
    this.onFuelStatusChanged();
  }
 else {
    markReferenceCoordForUpdate();
  }
  calculateReactorVolume();
  if (attachedCoolantPorts.size() > 0) {
    int outerVolume=StaticUtils.ExtraMath.Volume(minCoord,maxCoord) - reactorVolume;
    coolantContainer.setCapacity(Math.max(0,Math.min(50000,outerVolume * 100)));
  }
 else {
    coolantContainer.setCapacity(0);
  }
}
Program: 161330
Project: 161330
Buggy source:
/** 
 * Directly set the waste ejection setting. Will dispatch network updates from server to interested clients.
 * @param newSetting The new waste ejection setting.
 */
public void setWasteEjection(WasteEjectionSetting newSetting){
  if (this.wasteEjection != newSetting) {
    this.wasteEjection=newSetting;
    if (!this.worldObj.isRemote) {
      if (this.updatePlayers.size() > 0) {
        CoordTriplet coord=getReferenceCoord();
        for (        EntityPlayer player : updatePlayers) {
          CommonPacketHandler.INSTANCE.sendTo(new ReactorUpdateWasteEjectionMessage(this),(EntityPlayerMP)player);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Directly set the waste ejection setting. Will dispatch network updates from server to interested clients.
 * @param newSetting The new waste ejection setting.
 */
public void setWasteEjection(WasteEjectionSetting newSetting){
  if (this.wasteEjection != newSetting) {
    this.wasteEjection=newSetting;
    if (!this.worldObj.isRemote) {
      if (this.updatePlayers.size() > 0) {
        for (        EntityPlayer player : updatePlayers) {
          CommonPacketHandler.INSTANCE.sendTo(new ReactorUpdateWasteEjectionMessage(this),(EntityPlayerMP)player);
        }
      }
    }
  }
}
Program: 161331
Project: 161331
Buggy source:
public void setAllControlRodInsertionValues(int newValue){
  if (this.assemblyState != AssemblyState.Assembled) {
    return;
  }
  for (  TileEntityReactorControlRod cr : attachedControlRods) {
    if (cr != null && cr.isConnected()) {
      cr.setControlRodInsertion((short)newValue);
    }
  }
}

Fixed version (ground truth):
public void setAllControlRodInsertionValues(int newValue){
  if (this.assemblyState != AssemblyState.Assembled) {
    return;
  }
  for (  TileEntityReactorControlRod cr : attachedControlRods) {
    if (cr.isConnected()) {
      cr.setControlRodInsertion((short)newValue);
    }
  }
}
Program: 161333
Project: 161333
Buggy source:
private void moderateByFluid(RadiationData data,RadiationPacket radiation,Fluid fluid){
  float absorption, heatEfficiency, moderation;
  String name=fluid.getName();
  ReactorInteriorData moderatorData=ReactorInterior.getFluidData(fluid.getName());
  if (moderatorData == null) {
    moderatorData=waterData;
  }
  applyModerationFactors(data,radiation,moderatorData);
}

Fixed version (ground truth):
private void moderateByFluid(RadiationData data,RadiationPacket radiation,Fluid fluid){
  float absorption, heatEfficiency, moderation;
  ReactorInteriorData moderatorData=ReactorInterior.getFluidData(fluid.getName());
  if (moderatorData == null) {
    moderatorData=waterData;
  }
  applyModerationFactors(data,radiation,moderatorData);
}
Program: 161334
Project: 161334
Buggy source:
@Override public int[] getAccessibleSlotsFromSide(int side){
  int metadata=this.getBlockMetadata();
  if (isInlet()) {
    return kInletExposed;
  }
 else {
    return kOutletExposed;
  }
}

Fixed version (ground truth):
@Override public int[] getAccessibleSlotsFromSide(int side){
  if (isInlet()) {
    return kInletExposed;
  }
 else {
    return kOutletExposed;
  }
}
Program: 161335
Project: 161335
Buggy source:
/** 
 * @param newType The type of the new circuit.
 * @param param1 For input/control rods, the level(s) to change or set. For outputs, the numerical value
 * @param greaterThan For outputs, whether to activate when greater than or less than the outputLevel value. For input/control rods, whether to set (true) or change (false) the values.
 */
public void onReceiveUpdatePacket(int newType,int outputLevel,boolean greaterThan,boolean activeOnPulse){
  boolean oldTypeWasInput=this.isInput();
  this.circuitType=CircuitType.values()[newType];
  this.outputLevel=outputLevel;
  this.greaterThan=greaterThan;
  this.activeOnPulse=activeOnPulse;
  if (isAlwaysActiveOnPulse(circuitType)) {
    this.activeOnPulse=true;
  }
 else   if (TileEntityReactorRedNetPort.isOutput(this.circuitType)) {
    this.activeOnPulse=false;
  }
  if (this.isInput()) {
    ForgeDirection out=getOutwardsDir();
    this.isExternallyPowered=isReceivingRedstonePowerFrom(worldObj,xCoord + out.offsetX,yCoord + out.offsetY,zCoord + out.offsetZ,out);
    if (!this.isInputActiveOnPulse()) {
      onRedstoneInputUpdated();
    }
  }
 else {
    this.isExternallyPowered=false;
  }
  this.sendRedstoneUpdate();
  if (!this.worldObj.isRemote) {
    this.worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
    this.worldObj.markTileEntityChunkModified(xCoord,yCoord,zCoord,this);
  }
}

Fixed version (ground truth):
/** 
 * @param newType The type of the new circuit.
 * @param param1 For input/control rods, the level(s) to change or set. For outputs, the numerical value
 * @param greaterThan For outputs, whether to activate when greater than or less than the outputLevel value. For input/control rods, whether to set (true) or change (false) the values.
 */
public void onReceiveUpdatePacket(int newType,int outputLevel,boolean greaterThan,boolean activeOnPulse){
  this.circuitType=CircuitType.values()[newType];
  this.outputLevel=outputLevel;
  this.greaterThan=greaterThan;
  this.activeOnPulse=activeOnPulse;
  if (isAlwaysActiveOnPulse(circuitType)) {
    this.activeOnPulse=true;
  }
 else   if (TileEntityReactorRedNetPort.isOutput(this.circuitType)) {
    this.activeOnPulse=false;
  }
  if (this.isInput()) {
    ForgeDirection out=getOutwardsDir();
    this.isExternallyPowered=isReceivingRedstonePowerFrom(worldObj,xCoord + out.offsetX,yCoord + out.offsetY,zCoord + out.offsetZ,out);
    if (!this.isInputActiveOnPulse()) {
      onRedstoneInputUpdated();
    }
  }
 else {
    this.isExternallyPowered=false;
  }
  this.sendRedstoneUpdate();
  if (!this.worldObj.isRemote) {
    this.worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
    this.worldObj.markTileEntityChunkModified(xCoord,yCoord,zCoord,this);
  }
}
Program: 161336
Project: 161336
Buggy source:
@SideOnly(Side.CLIENT) public void setDisplayList(int newList){
  displayList=new Integer(newList);
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public void setDisplayList(int newList){
  displayList=newList;
}
Program: 161337
Project: 161337
Buggy source:
@Override public void onPoweredCycleEnd(){
  if (_inventories[SLOT_OUTLET] != null) {
    if (consumeInputs()) {
      _inventories[SLOT_OUTLET].stackSize+=1;
    }
  }
 else {
    ItemStack sourceItem=_inventories[SLOT_INLET];
    ArrayList<ItemStack> candidates=OreDictionaryArbiter.getOres("String_Node_Str");
    if (candidates == null || candidates.isEmpty()) {
      return;
    }
    if (consumeInputs()) {
      _inventories[SLOT_OUTLET]=candidates.get(0).copy();
      _inventories[SLOT_OUTLET].stackSize=1;
    }
  }
  distributeItemsFromSlot(SLOT_OUTLET);
  markChunkDirty();
}

Fixed version (ground truth):
@Override public void onPoweredCycleEnd(){
  if (_inventories[SLOT_OUTLET] != null) {
    if (consumeInputs()) {
      _inventories[SLOT_OUTLET].stackSize+=1;
    }
  }
 else {
    ArrayList<ItemStack> candidates=OreDictionaryArbiter.getOres("String_Node_Str");
    if (candidates == null || candidates.isEmpty()) {
      return;
    }
    if (consumeInputs()) {
      _inventories[SLOT_OUTLET]=candidates.get(0).copy();
      _inventories[SLOT_OUTLET].stackSize=1;
    }
  }
  distributeItemsFromSlot(SLOT_OUTLET);
  markChunkDirty();
}