Program: 3280
Project: 3280
Buggy source:
protected void read(DataInputStream s){
  try {
    referencing=Collections.synchronizedSet(new HashSet<String>());
    dirty=new AtomicBoolean(false);
    allocationMode=AllocationMode.valueOf(s.readUTF());
    length=s.readInt();
    Type t=Type.valueOf(s.readUTF());
    if (t == Type.DOUBLE) {
      if (allocationMode == AllocationMode.HEAP) {
        if (this.dataType() == Type.FLOAT) {
          floatData=new float[length()];
        }
 else         if (this.dataType() == Type.DOUBLE) {
          doubleData=new double[length()];
        }
 else {
          intData=new int[length()];
        }
        for (int i=0; i < length(); i++) {
          put(i,s.readDouble());
        }
      }
 else {
        wrappedBuffer=ByteBuffer.allocateDirect(length() * getElementSize());
        wrappedBuffer.order(ByteOrder.nativeOrder());
        for (int i=0; i < length(); i++) {
          put(i,s.readDouble());
        }
      }
    }
 else {
      if (allocationMode == AllocationMode.HEAP) {
        if (this.dataType() == Type.FLOAT) {
          floatData=new float[length()];
        }
 else         if (this.dataType() == Type.DOUBLE) {
          doubleData=new double[length()];
        }
 else {
          intData=new int[length()];
        }
        for (int i=0; i < length(); i++) {
          put(i,s.readFloat());
        }
      }
 else {
        wrappedBuffer=ByteBuffer.allocateDirect(length() * getElementSize());
        wrappedBuffer.order(ByteOrder.nativeOrder());
        for (int i=0; i < length(); i++) {
          put(i,s.readFloat());
        }
      }
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void read(DataInputStream s){
  try {
    referencing=Collections.synchronizedSet(new HashSet<String>());
    dirty=new AtomicBoolean(false);
    allocationMode=AllocationMode.valueOf(s.readUTF());
    length=s.readInt();
    Type t=Type.valueOf(s.readUTF());
    if (t == Type.DOUBLE) {
      if (allocationMode == AllocationMode.HEAP) {
        if (this.dataType() == Type.FLOAT) {
          floatData=new float[length()];
        }
 else         if (this.dataType() == Type.DOUBLE) {
          doubleData=new double[length()];
        }
 else {
          intData=new int[length()];
        }
        for (int i=0; i < length(); i++) {
          put(i,s.readDouble());
        }
      }
 else {
        wrappedBuffer=ByteBuffer.allocateDirect(length() * getElementSize());
        wrappedBuffer.order(ByteOrder.nativeOrder());
        for (int i=0; i < length(); i++) {
          put(i,s.readDouble());
        }
      }
    }
 else     if (t == Type.FLOAT) {
      if (allocationMode == AllocationMode.HEAP) {
        if (this.dataType() == Type.FLOAT) {
          floatData=new float[length()];
        }
 else         if (this.dataType() == Type.DOUBLE) {
          doubleData=new double[length()];
        }
 else {
          intData=new int[length()];
        }
        for (int i=0; i < length(); i++) {
          put(i,s.readFloat());
        }
      }
 else {
        wrappedBuffer=ByteBuffer.allocateDirect(length() * getElementSize());
        wrappedBuffer.order(ByteOrder.nativeOrder());
        for (int i=0; i < length(); i++) {
          put(i,s.readFloat());
        }
      }
    }
 else {
      if (allocationMode == AllocationMode.HEAP) {
        if (this.dataType() == Type.FLOAT) {
          floatData=new float[length()];
        }
 else         if (this.dataType() == Type.DOUBLE) {
          doubleData=new double[length()];
        }
 else {
          intData=new int[length()];
        }
        for (int i=0; i < length(); i++) {
          put(i,s.readInt());
        }
      }
 else {
        wrappedBuffer=ByteBuffer.allocateDirect(length() * getElementSize());
        wrappedBuffer.order(ByteOrder.nativeOrder());
        for (int i=0; i < length(); i++) {
          put(i,s.readInt());
        }
      }
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}