Class SourceIndexerEnvironment

java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.search.indexing.SourceIndexerEnvironment
All Implemented Interfaces:
ITypeRequestor

public final class SourceIndexerEnvironment extends Object implements ITypeRequestor
What SourceIndexer needs to resolve the documents of a project: its name environment and a lookup environment.

Both are costly to create and to fill. The index manager therefore keeps the last one, to resolve the next documents of the same project as a compiler would resolve the units of a batch: an indexer acquires one to resolve a document, and gives it back once the document is indexed, or if it is not to be. This class tells whether an environment can be reused.

A document is to be resolved as it would be with a new name environment and a new lookup environment:

  • the name environment is used as long as it is up to date;
  • the lookup environment is replaced by an empty one, see forgetTypes(), when the types it knows may not be the ones that a new one would find.
  • Field Details

    • MAX_UNITS_PROPERTY

      public static final String MAX_UNITS_PROPERTY
      The number of units after which the lookup environment is replaced, to limit what it retains. With 1, each document is resolved in its own lookup environment. Set with the system property "jdt.core.indexManager.maxResolvedUnits".
      See Also:
    • MAX_UNITS

      public static volatile int MAX_UNITS
    • KEEP_PROPERTY

      public static final String KEEP_PROPERTY
      Whether the index manager keeps an environment for the next document. If not, each document is resolved with a new name environment and a new lookup environment, as before environments were kept. Set with the system property "jdt.core.indexManager.keepSourceEnvironment".
      See Also:
    • KEEP

      public static volatile boolean KEEP
  • Method Details