I think this is being computed too early.  If there are deltas in this pack, they won't appear in the entry collection yet.  They don't get added until resolveDeltas runs.  Worse, if this is a thin pack, some detals don't get added until the middle of fixThinPack().

I think instead of doing this loop here, write a utility function that does:

  entries[entryCount++] = entry;

  if (needNewObjectIds)
    newObjectIds.add(entry);

and replace any location that assigns into the entries array with this utility method.  Except in fixThinPack when we add oe right after writeWholeObject.

And since you now need to allocate the set kind of early, maybe drop the boolean field altogether and use the set != null to determine if the set should be updated or not.