Program: 160555
Project: 160555
Buggy source:
public Set<ObjectIdentifier> getOidsOfName(String name,int pid,int rid) throws BimserverDatabaseException {
  Set<ObjectIdentifier> result=new HashSet<ObjectIdentifier>();
  for (  EClass eClass : getMetaDataManager().getAllSubClasses(Ifc2x3tc1Package.eINSTANCE.getIfcRoot())) {
    RecordIterator recordIterator=database.getKeyValueStore().getRecordIterator(eClass.getEPackage().getName() + "String_Node_Str" + eClass.getName(),BinUtils.intToByteArray(pid),BinUtils.intToByteArray(pid),this);
    try {
      Record record=recordIterator.next();
      while (record != null) {
        reads++;
        ByteBuffer buffer=ByteBuffer.wrap(record.getKey());
        int pidOfRecord=buffer.getInt();
        long oid=buffer.getLong();
        int ridOfRecord=-buffer.getInt();
        if (ridOfRecord == rid && pid == pidOfRecord) {
          ByteBuffer value=ByteBuffer.wrap(record.getValue());
          byte unsettablesSize=value.get();
          value.position(value.position() + unsettablesSize);
          if (value.capacity() > 1) {
            int stringLength=value.getInt();
            if (stringLength == -1) {
              return null;
            }
 else {
              BinUtils.readString(value,stringLength);
              if (value.getShort() != -1) {
                ;
                value.getLong();
              }
              stringLength=value.getInt();
              if (stringLength != -1) {
                String foundName=BinUtils.readString(value,stringLength);
                if (name.equals(foundName)) {
                  result.add(new ObjectIdentifier(oid,getCid(eClass)));
                }
              }
            }
          }
        }
        record=recordIterator.next();
      }
    }
  finally {
      recordIterator.close();
    }
  }
  return result;
}

Fixed version (ground truth):
public Set<ObjectIdentifier> getOidsOfName(String name,int pid,int rid) throws BimserverDatabaseException {
  Set<ObjectIdentifier> result=new HashSet<ObjectIdentifier>();
  for (  EClass eClass : getMetaDataManager().getAllSubClasses(Ifc2x3tc1Package.eINSTANCE.getIfcRoot())) {
    RecordIterator recordIterator=database.getKeyValueStore().getRecordIterator(eClass.getEPackage().getName() + "String_Node_Str" + eClass.getName(),BinUtils.intToByteArray(pid),BinUtils.intToByteArray(pid),this);
    try {
      Record record=recordIterator.next();
      while (record != null) {
        reads++;
        ByteBuffer buffer=ByteBuffer.wrap(record.getKey());
        int pidOfRecord=buffer.getInt();
        long oid=buffer.getLong();
        int ridOfRecord=-buffer.getInt();
        if (ridOfRecord == rid && pid == pidOfRecord) {
          ByteBuffer value=ByteBuffer.wrap(record.getValue());
          byte unsettablesSize=value.get();
          value.position(value.position() + unsettablesSize);
          if (value.capacity() > 1) {
            int stringLength=value.getInt();
            if (stringLength == -1) {
              return null;
            }
 else {
              BinUtils.readString(value,stringLength);
              if (value.getShort() != -1) {
                value.getLong();
              }
              stringLength=value.getInt();
              if (stringLength != -1) {
                String foundName=BinUtils.readString(value,stringLength);
                if (name.equals(foundName)) {
                  result.add(new ObjectIdentifier(oid,getCid(eClass)));
                }
              }
            }
          }
        }
        record=recordIterator.next();
      }
    }
  finally {
      recordIterator.close();
    }
  }
  return result;
}