Program: 11891
Project: 11891
Buggy source:
/** 
 * Pass in a chunk to load its data from file
 */
public TridentChunk loadChunkData(TridentWorld owner,ChunkLocation location) throws NBTException, IOException, DataFormatException {
  TridentChunk chunk=new TridentChunk(owner,location);
  short compression;
  byte[] compressedData;
synchronized (this.readWriteLock) {
    RandomAccessFile access=new RandomAccessFile(this.path.toFile(),"String_Node_Str");
    access.seek((long)this.sectors.getTimeStampLocation(chunk));
    int lastUpdate=access.readInt();
    if (chunk.getLastFileAccess() > lastUpdate) {
      chunk.setLastFileAccess((int)(System.currentTimeMillis() / 1000L));
      access.close();
      return chunk;
    }
 else {
      chunk.setLastFileAccess((int)(System.currentTimeMillis() / 1000L));
    }
    access.seek((long)this.sectors.getDataLocation(chunk));
    int length=access.readInt();
    compression=(short)access.readByte();
    compressedData=new byte[length - 1];
    access.readFully(compressedData);
    access.close();
  }
  byte[] chunkData;
switch (compression) {
case 0:
case 1:
    GZIPInputStream in=new GZIPInputStream(new ByteArrayInputStream(compressedData));
  chunkData=new byte[in.available()];
in.read(chunkData);
in.close();
break;
case 2:
Inflater inflater=new Inflater();
inflater.setInput(compressedData);
chunkData=new byte[inflater.getRemaining()];
inflater.inflate(chunkData);
inflater.end();
break;
default :
throw new IllegalStateException("String_Node_Str");
}
CompoundTag nbtData=new NBTDecoder(new DataInputStream(new ByteArrayInputStream(chunkData))).decode();
chunk.load(nbtData);
return chunk;
}

Fixed version (ground truth):
/** 
 * Pass in a chunk to load its data from file
 */
public TridentChunk loadChunkData(TridentWorld owner,ChunkLocation location) throws NBTException, IOException, DataFormatException {
  TridentChunk chunk=new TridentChunk(owner,location);
  short compression;
  byte[] compressedData;
synchronized (this.readWriteLock) {
    RandomAccessFile access=new RandomAccessFile(this.path.toFile(),"String_Node_Str");
    access.seek((long)this.sectors.getTimeStampLocation(chunk));
    int lastUpdate=access.readInt();
    if (chunk.getLastFileAccess() > lastUpdate) {
      chunk.setLastFileAccess((int)(System.currentTimeMillis() / 1000L));
      access.close();
      return chunk;
    }
 else {
      chunk.setLastFileAccess((int)(System.currentTimeMillis() / 1000L));
    }
    access.seek((long)this.sectors.getDataLocation(chunk));
    int length=access.readInt();
    compression=(short)access.readByte();
    compressedData=new byte[length - 1];
    access.readFully(compressedData);
    access.close();
  }
  byte[] chunkData;
switch (compression) {
case 0:
case 1:
    GZIPInputStream in=new GZIPInputStream(new ByteArrayInputStream(compressedData));
  chunkData=new byte[in.available()];
in.read(chunkData);
in.close();
break;
case 2:
Inflater inflater=new Inflater();
ByteArrayOutputStream output=new ByteArrayOutputStream();
inflater.setInput(compressedData);
byte[] buffer=new byte[1024];
while (!(inflater.finished())) {
int count=inflater.inflate(buffer);
output.write(buffer,0,count);
}
output.close();
chunkData=output.toByteArray();
inflater.end();
break;
default :
throw new IllegalStateException("String_Node_Str");
}
CompoundTag nbtData=new NBTDecoder(new DataInputStream(new ByteArrayInputStream(chunkData))).decode();
chunk.load(nbtData);
return chunk;
}