int assignPosition(Id id) throws RepositoryException {
  int pos=-1;
  if (!freePositions.isEmpty()) {
    pos=freePositions.remove(0);
  }
 else {
    pos=nextPos++;
    ensureCapacity(pos);
  }
  idPosMap.put(id,pos);
  for (  HierarchicalTypeStore s : superTypeStores) {
    s.assignPosition(id);
  }
  return pos;
}

int assignPosition ( Id id ) throws RepositoryException { int pos = - 1 ; if ( ! freePositions . isEmpty ( ) ) { pos = freePositions . remove ( 0 ) ; } else { pos = nextPos ++ ; ensureCapacity ( pos ) ; } idPosMap . put ( id , pos ) ; for ( HierarchicalTypeStore s : superTypeStores ) { s . assignPosition ( id ) ; } return pos ; }
assign a storage position to an id . - try to assign from freepositions - ensure storage capacity . - add entry in idposmap .
