Program: 26612
Project: 26612
Buggy source:
static <T>void testTypeDecoding(Decoder.Type type,Map<T,byte[]> tests) throws InvalidDatabaseException, IOException {
  for (  Map.Entry<T,byte[]> entry : tests.entrySet()) {
    T expect=entry.getKey();
    byte[] input=entry.getValue();
    String desc="String_Node_Str" + type.name() + "String_Node_Str"+ expect;
    FileChannel fc=DecoderTest.getFileChannel(input);
    MappedByteBuffer mmap=fc.map(MapMode.READ_ONLY,0,fc.size());
    try {
      Decoder decoder=new Decoder(new ThreadBuffer(mmap),0);
      decoder.POINTER_TEST_HACK=true;
      if (type.equals(Decoder.Type.BYTES)) {
        assertArrayEquals(desc,(byte[])expect,decoder.decode(0).getNode().binaryValue());
      }
 else       if (type.equals(Decoder.Type.ARRAY)) {
        assertEquals(desc,expect,decoder.decode(0).getNode());
      }
 else       if (type.equals(Decoder.Type.UINT16) || type.equals(Decoder.Type.INT32)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().asInt());
      }
 else       if (type.equals(Decoder.Type.UINT32) || type.equals(Decoder.Type.POINTER)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().asLong());
      }
 else       if (type.equals(Decoder.Type.UINT64) || type.equals(Decoder.Type.UINT128)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().bigIntegerValue());
      }
 else       if (type.equals(Decoder.Type.DOUBLE)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().asDouble());
      }
 else       if (type.equals(Decoder.Type.FLOAT)) {
        assertEquals(desc,new FloatNode((Float)expect),decoder.decode(0).getNode());
      }
 else       if (type.equals(Decoder.Type.UTF8_STRING)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().asText());
      }
 else       if (type.equals(Decoder.Type.BOOLEAN)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().asBoolean());
      }
 else {
        assertEquals(desc,expect,decoder.decode(0).getNode());
      }
    }
  finally {
      if (fc != null) {
        fc.close();
      }
    }
  }
}

Fixed version (ground truth):
static <T>void testTypeDecoding(Decoder.Type type,Map<T,byte[]> tests) throws InvalidDatabaseException, IOException {
  for (  Map.Entry<T,byte[]> entry : tests.entrySet()) {
    T expect=entry.getKey();
    byte[] input=entry.getValue();
    String desc="String_Node_Str" + type.name() + "String_Node_Str"+ expect;
    FileChannel fc=DecoderTest.getFileChannel(input);
    MappedByteBuffer mmap=fc.map(MapMode.READ_ONLY,0,fc.size());
    try {
      Decoder decoder=new Decoder(mmap,0);
      decoder.POINTER_TEST_HACK=true;
      if (type.equals(Decoder.Type.BYTES)) {
        assertArrayEquals(desc,(byte[])expect,decoder.decode(0).getNode().binaryValue());
      }
 else       if (type.equals(Decoder.Type.ARRAY)) {
        assertEquals(desc,expect,decoder.decode(0).getNode());
      }
 else       if (type.equals(Decoder.Type.UINT16) || type.equals(Decoder.Type.INT32)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().asInt());
      }
 else       if (type.equals(Decoder.Type.UINT32) || type.equals(Decoder.Type.POINTER)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().asLong());
      }
 else       if (type.equals(Decoder.Type.UINT64) || type.equals(Decoder.Type.UINT128)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().bigIntegerValue());
      }
 else       if (type.equals(Decoder.Type.DOUBLE)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().asDouble());
      }
 else       if (type.equals(Decoder.Type.FLOAT)) {
        assertEquals(desc,new FloatNode((Float)expect),decoder.decode(0).getNode());
      }
 else       if (type.equals(Decoder.Type.UTF8_STRING)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().asText());
      }
 else       if (type.equals(Decoder.Type.BOOLEAN)) {
        assertEquals(desc,expect,decoder.decode(0).getNode().asBoolean());
      }
 else {
        assertEquals(desc,expect,decoder.decode(0).getNode());
      }
    }
  finally {
      if (fc != null) {
        fc.close();
      }
    }
  }
}