public class CompilationProblemReporter extends Object
CompilationUnit
s to the
console.Constructor and Description |
---|
CompilationProblemReporter() |
Modifier and Type | Method and Description |
---|---|
static void |
indexErrors(CompilationErrorsIndex compilationErrorsIndex,
List<CompilationUnit> units)
Traverses a set of compilation units to record enough information to enable accurate and
detailed compilation error cause traces.
|
static UnableToCompleteException |
logAndTranslateException(TreeLogger logger,
Throwable e)
Used as a convenience to catch all exceptions thrown by the compiler.
|
static int |
logErrorTrace(TreeLogger logger,
TreeLogger.Type logLevel,
CompilerContext compilerContext,
List<CompilationUnit> units,
boolean hint)
Provides meaningful error messages and hints for types that failed to compile or are otherwise
missing.
|
static void |
logErrorTrace(TreeLogger logger,
TreeLogger.Type logLevel,
CompilerContext compilerContext,
String typeSourceName,
boolean hint)
Provides a meaning error message and hints for a type that failed to compile or is otherwise
missing.
|
static int |
logWarnings(TreeLogger logger,
TreeLogger.Type logLevelForWarnings,
List<CompilationUnit> units) |
static boolean |
reportErrors(TreeLogger logger,
CompilationUnit unit,
boolean suppressErrors)
Logs errors to the console.
|
public static void indexErrors(CompilationErrorsIndex compilationErrorsIndex, List<CompilationUnit> units)
public static UnableToCompleteException logAndTranslateException(TreeLogger logger, Throwable e)
InternalCompilerException
, extra diagnostics are
printed.logger
- logger used to report errors to the consolee
- the exception to analyze and logUnableToCompleteException
so
that the calling method can declare a more narrow 'throws
UnableToCompleteException'public static int logErrorTrace(TreeLogger logger, TreeLogger.Type logLevel, CompilerContext compilerContext, List<CompilationUnit> units, boolean hint)
public static void logErrorTrace(TreeLogger logger, TreeLogger.Type logLevel, CompilerContext compilerContext, String typeSourceName, boolean hint)
public static int logWarnings(TreeLogger logger, TreeLogger.Type logLevelForWarnings, List<CompilationUnit> units)
public static boolean reportErrors(TreeLogger logger, CompilationUnit unit, boolean suppressErrors)
logger
- logger for reporting errors to the consoleunit
- Compilation unit that may have errorssuppressErrors
- Controls he log level for logging errors. If false
is passed,
compilation errors are logged at TreeLogger.ERROR and warnings logged at
TreeLogger.WARN. If true
is passed, compilation errors are logged at
TreeLogger.TRACE and TreeLogger.DEBUG.true
if an error was logged.Copyright © 2018. All rights reserved.