docs: void clearInconsistencies(long newtable, int newsize)
                      throws IOException,
                      EOFException,
                      ClassNotFoundException,
                      FileManagerException,
                      HashtableOnDiskException {
          //long oldtable = header.currentTable();
          //int oldsize = header.tablesize();
  
          for (int i = 0; i < newsize; i++) { // we iterate the NEW table
              long diskloc = newtable + (i * DWORDSIZE);
              filemgr.seek(diskloc);
              long location = filemgr.readLong(); // get existing chain head in NEW table
  
              if (header.rehashInProgress == location) {
                  //
                  // if this occurs we had just started a rehash but not
                  // actually changed a table - i.e. step 1a in rehash(), and
                  // ONLY step 1a has occurred. Step 1a saves the pointer in the
                  // new hashtable index in rehashInProgress so that the
                  // next physical  write can unchain the hash chain it points
                  // to in prep for inserting the new item at the head of the
                  // chain.  So if the above comparison is TRUE, that means we
                  // have saved the chain pointer but not yet updated the pointer
                  // in the new hashtable index (step 2).
                  //
                  // Therefore we can clear the rehashInProgress flag to "1" and
                  // simply complete the rehash (because the structures are still
                  // consistent).
                  //
                  header.setRehashFlag(1);
                  return;
              }
  
              HashtableEntry e = readEntry(location, 0, RETRIEVE_KEY, !CHECK_EXPIRED,
                                           header.alternateTableId()); // read next item from NEW table
  
              while (e != null) { // walk down chain
                  HashtableEntry oe = findEntry(e.key, e.hash, RETRIEVE_KEY, !CHECK_EXPIRED, 0,
                                                header.currentTableId()); // see if it is in oldtable also
  
                  if (oe == null) { // not in old table
                      //
                      // We must check the "next" pointer on the new entry. If it
                      // is not 0, check to see if "next" points to an entry in
                      // the old table.  If so, the crash was between steps 2 and
                      // 3 in rehash(). 
                      //
                      if (e.next == 0) {
                          if (header.rehashInProgress != 1) {
                              e.next = header.rehashInProgress;
                          }
                          updatePointer(e.location, e.next);
  
                          header.setRehashFlag(1);
                          htoddc.returnToHashtableEntryPool(e);
                          return;
  
                      } else {
                          HashtableEntry ne = readEntry(e.next, 0, RETRIEVE_KEY, !CHECK_EXPIRED, header.alternateTableId());
                          oe = findEntry(ne.key, ne.hash, RETRIEVE_KEY, !CHECK_EXPIRED, 0,
                                         header.currentTableId());
                          htoddc.returnToHashtableEntryPool(ne);
                          if (oe != null) {
                              //
                              // The "next" entry is in the old table.  Fix up
                              // e.next and we're done.
                              //
                              if (header.rehashInProgress == 1) {
                                  e.next = 0;
                              } else {
                                  e.next = header.rehashInProgress;
                              }
                              updatePointer(e.location, e.next);
  
                              header.setRehashFlag(1);
                              htoddc.returnToHashtableEntryPool(oe);
                              htoddc.returnToHashtableEntryPool(e);
                              return;
                          }
                      }
  
                  } else { // it is in old table
                      //
                      // If it is in both tables we crashed just before step 2 in
                      // rehash().  We will back out the partial update and trust
                      // the resume of rehash to redo things correctly.  The
                      // rehashInProgress value is 1 if there were no other items
                      // in the bucket, and it points to the other items which
                      // were temporarily unchained otherwise.
                      //
                      filemgr.seek(diskloc);
                      if (header.rehashInProgress == 1) {
                          //
                          // If here that means that step 1a in rehash was NOT run, which means
                          // there was no existing hash chain in the new table at this location,
                          // so we can zap the entry back to 0.
                          //
                          filemgr.writeLong(0); // clear "new" entry
                      } else {
                          //
                          // If here that means step 1a DID run, so there WAS alrady a chain in the
                          // new table at this location.  rehash() saved the head of that chain in
                          // the rehash flat so we can restore the new table like this.
                          //
                          filemgr.writeLong(header.rehashInProgress); // rechain things
                      }
                      header.setRehashFlag(1);
                      htoddc.returnToHashtableEntryPool(oe);
                      htoddc.returnToHashtableEntryPool(e);
                      return;
                  }
                  long nextLocation = e.next;
                  htoddc.returnToHashtableEntryPool(e);
                  e = readEntry(nextLocation, 0, RETRIEVE_KEY, !CHECK_EXPIRED, header.alternateTableId());
              }
          }
      }