Program: 113141
Project: 113141
Buggy source:
@Override protected byte[] defaultTypeDataToBinary(){
  final String encodedType=DataUtilities.encodeType(persistedType);
  final String typeName=reprojectedType.getTypeName();
  final byte[] typeNameBytes=StringUtils.stringToBinary(typeName);
  final byte[] fieldVisibilityAtributeNameBytes=StringUtils.stringToBinary(visibilityAttributeName);
  final byte[] visibilityManagementClassNameBytes=StringUtils.stringToBinary(fieldVisibilityManagement.getClass().getCanonicalName());
  final TimeDescriptors timeDescriptors=inferTimeAttributeDescriptor(persistedType);
  final byte[] timeAndRangeBytes=timeDescriptors.toBinary();
  final String namespace=this.reprojectedType.getName().getNamespaceURI();
  byte[] namespaceBytes;
  if (namespace != null) {
    namespaceBytes=StringUtils.stringToBinary(namespace);
  }
 else {
    namespaceBytes=new byte[0];
  }
  final byte[] encodedTypeBytes=StringUtils.stringToBinary(encodedType);
  final ByteBuffer buf=ByteBuffer.allocate(encodedTypeBytes.length + typeNameBytes.length + namespaceBytes.length+ fieldVisibilityAtributeNameBytes.length+ visibilityManagementClassNameBytes.length+ timeAndRangeBytes.length+ 20);
  buf.putInt(typeNameBytes.length);
  buf.putInt(namespaceBytes.length);
  buf.putInt(fieldVisibilityAtributeNameBytes.length);
  buf.putInt(visibilityManagementClassNameBytes.length);
  buf.putInt(timeAndRangeBytes.length);
  buf.put(typeNameBytes);
  buf.put(namespaceBytes);
  buf.put(fieldVisibilityAtributeNameBytes);
  buf.put(visibilityManagementClassNameBytes);
  buf.put(timeAndRangeBytes);
  buf.put(encodedTypeBytes);
  return buf.array();
}

Fixed version (ground truth):
@Override protected byte[] defaultTypeDataToBinary(){
  final String encodedType=DataUtilities.encodeType(persistedType);
  final String typeName=reprojectedType.getTypeName();
  final byte[] typeNameBytes=StringUtils.stringToBinary(typeName);
  final byte[] fieldVisibilityAtributeNameBytes=StringUtils.stringToBinary(visibilityAttributeName);
  final byte[] visibilityManagementClassNameBytes=StringUtils.stringToBinary(fieldVisibilityManagement.getClass().getCanonicalName());
  final TimeDescriptors timeDescriptors=inferTimeAttributeDescriptor(persistedType);
  final byte[] timeAndRangeBytes=timeDescriptors.toBinary();
  final String namespace=reprojectedType.getName().getNamespaceURI();
  byte[] namespaceBytes;
  if ((namespace != null) && (namespace.length() > 0)) {
    namespaceBytes=StringUtils.stringToBinary(namespace);
  }
 else {
    namespaceBytes=new byte[0];
  }
  final byte[] encodedTypeBytes=StringUtils.stringToBinary(encodedType);
  final ByteBuffer buf=ByteBuffer.allocate(encodedTypeBytes.length + typeNameBytes.length + namespaceBytes.length+ fieldVisibilityAtributeNameBytes.length+ visibilityManagementClassNameBytes.length+ timeAndRangeBytes.length+ 20);
  buf.putInt(typeNameBytes.length);
  buf.putInt(namespaceBytes.length);
  buf.putInt(fieldVisibilityAtributeNameBytes.length);
  buf.putInt(visibilityManagementClassNameBytes.length);
  buf.putInt(timeAndRangeBytes.length);
  buf.put(typeNameBytes);
  buf.put(namespaceBytes);
  buf.put(fieldVisibilityAtributeNameBytes);
  buf.put(visibilityManagementClassNameBytes);
  buf.put(timeAndRangeBytes);
  buf.put(encodedTypeBytes);
  return buf.array();
}