Required by IndexEntryAccessCapability.
351054
public <S extends Storable> IndexEntryAccessor<S>[]
        getIndexEntryAccessors(Class<S> storableType)
        throws RepositoryException
    {
        if (Unindexed.class.isAssignableFrom(storableType)) {
            return new IndexEntryAccessor[0];
        }

        Storage<S> masterStorage = mRepository.storageFor(storableType);
        IndexAnalysis<S> analysis = mIndexAnalysisPool.get(masterStorage);

        List<IndexEntryAccessor<S>> accessors =
            new ArrayList<IndexEntryAccessor<S>>(analysis.allIndexInfoMap.size());
        for (IndexInfo info : analysis.allIndexInfoMap.values()) {
            if (info instanceof IndexEntryAccessor) {
                accessors.add((IndexEntryAccessor<S>) info);
            }
        }
        return accessors.toArray(new IndexEntryAccessor[accessors.size()]);
    }
726908
private void indexInTransaction(SVNRepository repository, SVNLogEntry logEntry) throws SVNException {
        // Log values
        long revision = logEntry.getRevision();
        String author = logEntry.getAuthor();
        String message = logEntry.getMessage();
        Date date = logEntry.getDate();
        // Sanitizes the possible null values
        author = Objects.toString(author, "");
        message = Objects.toString(message, "");
        // Date to date time
        LocalDateTime dateTime = Time.from(date, Time.now());
        // Branch for the revision
        String branch = getBranchForRevision(repository, logEntry);
        // Logging
        logger.info(String.format("Indexing revision %d", revision));
        // Inserting or updating the revision
        revisionDao.addRevision(repository.getId(), revision, author, dateTime, message, branch);
        // Merge relationships (using a nested SVN client)
        try (Transaction ignored = transactionService.start(true)) {
            List<Long> mergedRevisions = svnClient.getMergedRevisions(repository, SVNUtils.toURL(repository.getConfiguration().getUrl(), branch), revision);
            // Unique revisions
            List<Long> uniqueMergedRevisions = mergedRevisions.stream().distinct().collect(Collectors.toList());
            revisionDao.addMergedRevisions(repository.getId(), revision, uniqueMergedRevisions);
        }
        // Subversion events
        indexSVNEvents(repository, logEntry);
        // Indexes the issues
        indexIssues(repository, logEntry);
    }
1063767
private static IndexedTypeSet toRootEntities(ExtendedSearchIntegrator extendedIntegrator, Class<?>... selection) {
		Set<Class<?>> entities = new HashSet<Class<?>>();
		//first build the "entities" set containing all indexed subtypes of "selection".
		for ( Class<?> entityType : selection ) {
			IndexedTypeSet targetedClasses = extendedIntegrator.getIndexedTypesPolymorphic( IndexedTypeSets.fromClass( entityType ) );
			if ( targetedClasses.isEmpty() ) {
				String msg = entityType.getName() + " is not an indexed entity or a subclass of an indexed entity";
				throw new IllegalArgumentException( msg );
			}
			entities.addAll( targetedClasses.toPojosSet() );
		}
		Set<Class<?>> cleaned = new HashSet<Class<?>>();
		Set<Class<?>> toRemove = new HashSet<Class<?>>();
		//now remove all repeated types to avoid duplicate loading by polymorphic query loading
		for ( Class<?> type : entities ) {
			boolean typeIsOk = true;
			for ( Class<?> existing : cleaned ) {
				if ( existing.isAssignableFrom( type ) ) {
					typeIsOk = false;
					break;
				}
				if ( type.isAssignableFrom( existing ) ) {
					toRemove.add( existing );
				}
			}
			if ( typeIsOk ) {
				cleaned.add( type );
			}
		}
		cleaned.removeAll( toRemove );
		log.debugf( "Targets for indexing job: %s", cleaned );
		return IndexedTypeSets.fromClasses( cleaned.toArray( new Class[cleaned.size()] ) );
	}
135133
protected <T extends DSet.Entry> void requestEntryAdd (String name, DSet<T> set, T entry)
    {
        // if we're on the authoritative server, we update the set immediately
        boolean applyImmediately = isAuthoritative();
        if (applyImmediately) {
            set.add(entry);
        }
        // dispatch an entry added event
        postEvent(new EntryAddedEvent<T>(_oid, name, entry).setAlreadyApplied(applyImmediately));
    }
849038
@SuppressWarnings("unchecked")
    private void validateKey(int index) {
        final int size = (index + 1);
        if (null == this.keys) {
            // nothing has been created yet
            this.keys = (K[]) new Object[size];
        } else if (index >= this.keys.length) {
            // this row puts us beyond the current storage
            Object[] newKeys = new Object[size];
            System.arraycopy(this.keys, 0, newKeys, 0, this.keys.length);
            this.keys = (K[]) newKeys;
        }
    }
845353
public FormEntry getFormEntry(final String entryKey, final int index) {
		return getFormEntry(entryKey + JFunkConstants.INDEXED_KEY_SEPARATOR + index);
	}
1021415
function () {
            var self = this,
                requiresWithAlias = self.requiresWithAlias,
                requires = self.requires;
            if (!requires || requires.length === 0) {
                return requires || [];
            } else if (!requiresWithAlias) {
                self.requiresWithAlias = requiresWithAlias =
                    Utils.normalizeModNamesWithAlias(requires, self.name);
            }
            return requiresWithAlias;
        }
122691
private Object getEntryAfterMiss(TransactionLocal key, int i, Entry e)
    {
        Entry[] tab = table;
        int len = tab.length;

        while (e != null)
        {
            if (e.key == key)
                return e.value;
            i = nextIndex(i, len);
            e = tab[i];
        }
        return null;
    }
785838
@SuppressWarnings("unchecked")
   private boolean isIndexRecoveryRequired() throws RepositoryException
   {
      // instantiate filters first, if not initialized
      if (recoveryFilters == null)
      {
         recoveryFilters = new ArrayList<AbstractRecoveryFilter>();
         log.info("Initializing RecoveryFilters.");
         // add default filter, if none configured.
         if (recoveryFilterClasses.isEmpty())
         {
            this.recoveryFilterClasses.add(DocNumberRecoveryFilter.class.getName());
         }
         for (String recoveryFilterClassName : recoveryFilterClasses)
         {
            AbstractRecoveryFilter filter = null;
            Class<? extends AbstractRecoveryFilter> filterClass;
            try
            {
               filterClass =
                  (Class<? extends AbstractRecoveryFilter>)ClassLoading.forName(recoveryFilterClassName, this);
               Constructor<? extends AbstractRecoveryFilter> constuctor = filterClass.getConstructor(SearchIndex.class);
               filter = constuctor.newInstance(this);
               recoveryFilters.add(filter);
            }
            catch (ClassNotFoundException e)
            {
               throw new RepositoryException(e.getMessage(), e);
            }
            catch (IllegalArgumentException e)
            {
               throw new RepositoryException(e.getMessage(), e);
            }
            catch (InstantiationException e)
            {
               throw new RepositoryException(e.getMessage(), e);
            }
            catch (IllegalAccessException e)
            {
               throw new RepositoryException(e.getMessage(), e);
            }
            catch (InvocationTargetException e)
            {
               throw new RepositoryException(e.getMessage(), e);
            }
            catch (SecurityException e)
            {
               throw new RepositoryException(e.getMessage(), e);
            }
            catch (NoSuchMethodException e)
            {
               throw new RepositoryException(e.getMessage(), e);
            }
         }
      }

      // invoke filters
      for (AbstractRecoveryFilter filter : recoveryFilters)
      {
         if (filter.accept())
         {
            return true;
         }
      }
      return false;
   }
585076
private void expandTo(int wordIndex) {
		int wordsRequired = wordIndex+1;
		if (wordsInUse < wordsRequired) {
			ensureCapacity(wordsRequired);
			wordsInUse = wordsRequired;
		}
	}
449498
public void addIndex(final OIndexDefinition indexDefinition) {
    indexDefinitions.add(indexDefinition);
    if (indexDefinition instanceof OIndexDefinitionMultiValue) {
      if (multiValueDefinitionIndex == -1)
        multiValueDefinitionIndex = indexDefinitions.size() - 1;
      else
        throw new OIndexException("Composite key can not contain more than one collection item");
    }

  }
934528
private void ensureCapacity(final int index, final int length)
    {
        if (index < 0)
        {
            throw new IndexOutOfBoundsException("index cannot be negative: index=" + index);
        }

        final long resultingPosition = index + (long)length;
        final int currentCapacity = capacity;
        if (resultingPosition > currentCapacity)
        {
            if (currentCapacity >= MAX_BUFFER_LENGTH)
            {
                throw new IndexOutOfBoundsException(
                    "index=" + index + " length=" + length + " maxCapacity=" + MAX_BUFFER_LENGTH);
            }

            final int newCapacity = calculateExpansion(currentCapacity, (int)resultingPosition);
            final ByteBuffer newBuffer = ByteBuffer.allocateDirect(newCapacity);

            getBytes(0, newBuffer, 0, capacity);

            address = address(newBuffer);
            capacity = newCapacity;
            byteBuffer = newBuffer;
        }
    }
183849
private void ensureCapacity(int index)
  {
    int capacity = words == null ? 0 : words.length;
    if (capacity > index) {
      return;
    }
    capacity = Math.max(capacity << 1, index + 1);

    if (words == null) {
      // nothing to copy
      words = new int[capacity];
      return;
    }
    words = Arrays.copyOf(words, capacity);
  }
618236
private void required(String attributeName, Resource attributValue, boolean exists) throws ApplicationException {
	if (attributValue == null)
	    throw new ApplicationException("invalid attribute constellation for the tag zip", "attribute [" + attributeName + "] is required, if action is [" + action + "]");

	if (exists && !attributValue.exists()) throw new ApplicationException(attributeName + " resource [" + attributValue + "] doesn't exist");
	else if (exists && !attributValue.canRead()) throw new ApplicationException("no access to " + attributeName + " resource [" + attributValue + "]");

    }
416812
def ensure_index(self, key, sparse=False):
        
        self.create_index(key, reindex=False, sparse=False)
299264
def requires(self):
        
        for url in NEWSPAPERS:
            yield IndexPage(url=url, date=self.date)
227648
def go_to_index(self, index):
        
        return CompletionState(self.original_document, self.current_completions, complete_index=index)