Class CompilationResult

java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult

public class CompilationResult extends Object
A compilation result consists of all information returned by the compiler for a single compiled compilation source unit. This includes:
  • the compilation unit that was compiled
  • for each type produced by compiling the compilation unit, its binary and optionally its principal structure
  • any problems (errors or warnings) produced
  • dependency info
The principle structure and binary may be null if the compiler could not produce them. If neither could be produced, there is no corresponding entry for the type. The dependency info includes type references such as supertypes, field types, method parameter and return types, local variable types, types of intermediate expressions, etc. It also includes the namespaces (packages) in which names were looked up. It does not include finer grained dependencies such as information about specific fields and methods which were referenced, but does contain their declaring types and any other types used to locate such fields or methods.
  • Field Details

    • problems

      public CategorizedProblem[] problems
    • tasks

      public CategorizedProblem[] tasks
    • problemCount

      public int problemCount
    • taskCount

      public int taskCount
    • compilationUnit

      public ICompilationUnit compilationUnit
    • qualifiedReferences

      public char[][][] qualifiedReferences
    • simpleNameReferences

      public char[][] simpleNameReferences
    • rootReferences

      public char[][] rootReferences
    • hasAnnotations

      public boolean hasAnnotations
    • hasFunctionalTypes

      public boolean hasFunctionalTypes
    • lineSeparatorPositions

      public int[] lineSeparatorPositions
    • recoveryScannerData

      public RecoveryScannerData recoveryScannerData
    • compiledTypes

      public Map compiledTypes
    • unitIndex

      public int unitIndex
    • totalUnitsKnown

      public int totalUnitsKnown
    • hasBeenAccepted

      public boolean hasBeenAccepted
    • fileName

      public char[] fileName
    • hasInconsistentToplevelHierarchies

      public boolean hasInconsistentToplevelHierarchies
    • hasSyntaxError

      public boolean hasSyntaxError
    • packageName

      public char[][] packageName
    • checkSecondaryTypes

      public boolean checkSecondaryTypes
    • annotations

      public List<AnnotationBinding[]> annotations
    • usesPreview

      public boolean usesPreview
  • Constructor Details

    • CompilationResult

      public CompilationResult(char[] fileName, int unitIndex, int totalUnitsKnown, int maxProblemPerUnit)
    • CompilationResult

      public CompilationResult(ICompilationUnit compilationUnit, int unitIndex, int totalUnitsKnown, int maxProblemPerUnit)
  • Method Details

    • getAllProblems

      public CategorizedProblem[] getAllProblems()
    • getClassFiles

      public ClassFile[] getClassFiles()
    • getCompilationUnit

      public ICompilationUnit getCompilationUnit()
      Answer the initial compilation unit corresponding to the present compilation result
    • getErrors

      public CategorizedProblem[] getErrors()
      Answer the errors encountered during compilation.
    • getFileName

      public char[] getFileName()
      Answer the initial file name
    • getLineSeparatorPositions

      public int[] getLineSeparatorPositions()
    • getProblems

      public CategorizedProblem[] getProblems()
      Answer the problems (errors and warnings) encountered during compilation. This is not a compiler internal API - it has side-effects ! It is intended to be used only once all problems have been detected, and makes sure the problems slot as the exact size of the number of problems.
    • getCUProblems

      public CategorizedProblem[] getCUProblems()
      Same as getProblems() but don't answer problems that actually concern the enclosing package.
    • getTasks

      public CategorizedProblem[] getTasks()
      Answer the tasks (TO-DO, ...) encountered during compilation. This is not a compiler internal API - it has side-effects ! It is intended to be used only once all problems have been detected, and makes sure the problems slot as the exact size of the number of problems.
    • hasErrors

      public boolean hasErrors()
    • hasMandatoryErrors

      public boolean hasMandatoryErrors()
    • hasProblems

      public boolean hasProblems()
    • hasTasks

      public boolean hasTasks()
    • hasWarnings

      public boolean hasWarnings()
    • recordPackageName

      public void recordPackageName(char[][] packName)
    • record

      public void record(CategorizedProblem newProblem, ReferenceContext referenceContext)
    • record

      public void record(CategorizedProblem newProblem, ReferenceContext referenceContext, boolean mandatoryError)
    • record

      public void record(char[] typeName, ClassFile classFile)
      For now, remember the compiled type using its compound name.
    • removeProblem

      public void removeProblem(CategorizedProblem problem)
    • tagAsAccepted

      public CompilationResult tagAsAccepted()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • scheduleProblem

      public void scheduleProblem(Runnable task)
    • materializeProblems

      public void materializeProblems()
    • cacheSource

      public void cacheSource()
    • getContents

      public char[] getContents()
    • cacheContents

      public void cacheContents(char[] contents)
    • releaseContent

      public void releaseContent()
    • isFromBinarySource

      public boolean isFromBinarySource()
    • noSourceAvailable

      public void noSourceAvailable()
    • removeProblems

      public int removeProblems(CompilationResult.ProblemsForRemovalFilter pf)
      Can be used to tidy up the problems set, if a problem is accepted by the filter, it will be removed. Returns number of problems removed.