Program: 11179
Project: 11179
Buggy source:
public void replaceValues(int[] min,int[] max,Integer[] replacement,Integer[] otherwise) throws TilerException {
  if (min.length != bufferBandCount || max.length != bufferBandCount || replacement.length != bufferBandCount || otherwise.length != bufferBandCount) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  boolean allNull=true;
  for (int b=0; b < bufferBandCount; b++) {
    if (replacement[b] != null || otherwise[b] != null) {
      allNull=false;
      break;
    }
  }
  if (allNull) {
    return;
  }
  for (int y=0; y < height; y++) {
    for (int x=0; x < width; x++) {
      boolean between=true;
      for (int b=0; b < bufferBandCount; b++) {
        int index=getBufferIndex(x,y,b) * bufferTypeSize;
        int value=0;
        if (bufferType == gdalconstConstants.GDT_Byte) {
          value=buffer.get(index) & 0xff;
        }
 else         if (bufferType == gdalconstConstants.GDT_Int16 || bufferType == gdalconstConstants.GDT_UInt16) {
          value=buffer.getShort(index);
        }
 else         if (bufferType == gdalconstConstants.GDT_Int32 || bufferType == gdalconstConstants.GDT_UInt32) {
          value=buffer.getInt(index);
        }
 else {
          throw new TilerException("String_Node_Str");
        }
        if (value < min[b] || value > max[b]) {
          between=false;
          break;
        }
      }
      Integer[] values=between ? replacement : otherwise;
      for (int b=0; b < bufferBandCount; b++) {
        if (values[b] != null) {
          int index=getBufferIndex(x,y,b) * bufferTypeSize;
          int value=values[b];
          if (bufferType == gdalconstConstants.GDT_Byte) {
            buffer.put(index,(byte)value);
          }
 else           if (bufferType == gdalconstConstants.GDT_Int16 || bufferType == gdalconstConstants.GDT_UInt16) {
            buffer.putShort(index,(short)value);
          }
 else           if (bufferType == gdalconstConstants.GDT_Int32 || bufferType == gdalconstConstants.GDT_UInt32) {
            buffer.putInt(index,value);
          }
 else {
            throw new TilerException("String_Node_Str");
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void replaceValues(NumberArray min,NumberArray max,NullableNumberArray replacement,NullableNumberArray otherwise) throws TilerException {
  if (min.length() != bufferBandCount || max.length() != bufferBandCount || replacement.length() != bufferBandCount || otherwise.length() != bufferBandCount)   throw new IllegalArgumentException("String_Node_Str");
  boolean allNull=true;
  for (int b=0; b < bufferBandCount; b++) {
    if (replacement.getDouble(b) != null || otherwise.getDouble(b) != null) {
      allNull=false;
      break;
    }
  }
  if (allNull) {
    return;
  }
  for (int y=0; y < height; y++) {
    for (int x=0; x < width; x++) {
      boolean between=true;
      for (int b=0; b < bufferBandCount; b++) {
        int index=getBufferIndex(x,y,b) * bufferTypeSize;
        if (floatingPoint) {
          double value=getDoubleValue(index,buffer,bufferType);
          if (value < min.getDouble(b) || value > max.getDouble(b)) {
            between=false;
            break;
          }
        }
 else {
          long value=getLongValue(index,buffer,bufferType);
          if (value < min.getLong(b) || value > max.getLong(b)) {
            between=false;
            break;
          }
        }
      }
      NullableNumberArray values=between ? replacement : otherwise;
      for (int b=0; b < bufferBandCount; b++) {
        if (values.getDouble(b) != null) {
          int index=getBufferIndex(x,y,b) * bufferTypeSize;
          if (floatingPoint) {
            putDoubleValue(index,buffer,bufferType,values.getDouble(b));
          }
 else {
            putLongValue(index,buffer,bufferType,values.getLong(b));
          }
        }
      }
    }
  }
}