All warnings must be in the same LintCategory provided to the constructor.
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
| Modifier and Type | Class and Description |
|---|---|
| private static enum | WarningAggregator.
The kinds of different deferred diagnostics that might be generated if a warning is suppressed because too many warnings have already been output. |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | anyWarningEmitted
Whether we have actually emitted a warning or just deferred everything. |
| private Object | deferredDiagnosticArg
An optional argument to be used when constructing the deferred diagnostic message, based on deferredDiagnosticKind. |
| private WarningAggregator. | deferredDiagnosticKind
A variable indicating the latest best guess at what the final deferred diagnostic will be. |
| private JavaFileObject | deferredDiagnosticSource
If deferredDiagnosticKind is IN_FILE or ADDITIONAL_IN_FILE, this variable gives the value of log.currentSource() for the file in question. |
| private final Lint. | lintCategory
A LintCategory to be included in point-of-use diagnostics to indicate how messages might be suppressed (i.e. with @SuppressWarnings). |
| private final Log | log
The log to which to report warnings. |
| private final String | prefix
The common prefix for all I18N message keys generated by this handler. |
| private final Source | |
| private Set | sourcesWithReportedWarnings
A set containing the names of the source files for which specific warnings have been generated -- i.e. in verbose mode. |
| Access | Constructor and Description |
|---|---|
| public | WarningAggregator(Log
The log on which to generate any diagnostics log, Source Associated source file, or null for none source, Lint.The lint category for all warnings lcCreate an aggregator for warnings. |
| public | WarningAggregator(Log
The log on which to generate any diagnostics log, Source Associated source file, or null for none source, Lint.The lint category for all warnings lc,A common prefix for the set of message keys for the messages
that may be generated, or null to infer from the lint category. prefix)Create an aggregator for warnings. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public boolean | Returns: true if diagnostic should be emitted, otherwise falsethe warning diagnostic, boolean whether the warning's lint category is enabled verbose)Aggregate a warning and determine whether to emit it. |
| public List | |
| public void |
| anyWarningEmitted | back to summary |
|---|---|
| private boolean anyWarningEmitted Whether we have actually emitted a warning or just deferred everything. In the latter case, the "recompile" notice is included in the summary. | |
| deferredDiagnosticArg | back to summary |
|---|---|
| private Object deferredDiagnosticArg An optional argument to be used when constructing the deferred diagnostic message, based on deferredDiagnosticKind. This variable should normally be set/updated whenever deferredDiagnosticKind is updated. | |
| deferredDiagnosticKind | back to summary |
|---|---|
| private WarningAggregator. A variable indicating the latest best guess at what the final deferred diagnostic will be. Initially as specific and helpful as possible, as more warnings are reported, the scope of the diagnostic will be broadened. | |
| deferredDiagnosticSource | back to summary |
|---|---|
| private JavaFileObject deferredDiagnosticSource If deferredDiagnosticKind is IN_FILE or ADDITIONAL_IN_FILE, this variable gives the value of log.currentSource() for the file in question. | |
| lintCategory | back to summary |
|---|---|
| private final Lint. A LintCategory to be included in point-of-use diagnostics to indicate how messages might be suppressed (i.e. with @SuppressWarnings). | |
| log | back to summary |
|---|---|
| private final Log log The log to which to report warnings. | |
| prefix | back to summary |
|---|---|
| private final String prefix The common prefix for all I18N message keys generated by this handler. | |
| source | back to summary |
|---|---|
| private final Source source | |
| sourcesWithReportedWarnings | back to summary |
|---|---|
| private Set<JavaFileObject> sourcesWithReportedWarnings A set containing the names of the source files for which specific warnings have been generated -- i.e. in verbose mode. If a source name appears in this list, then deferred diagnostics will be phrased to include "additionally"... | |
| WarningAggregator | back to summary |
|---|---|
| public WarningAggregator(Log log, Source source, Lint. Create an aggregator for warnings.
| |
| WarningAggregator | back to summary |
|---|---|
| public WarningAggregator(Log log, Source source, Lint. Create an aggregator for warnings.
| |
| addNote | back to summary |
|---|---|
| private void addNote(List<JCDiagnostic> list, JavaFileObject file, String msg, Object... args) | |
| aggregate | back to summary |
|---|---|
| public boolean aggregate(JCDiagnostic diagnostic, boolean verbose) Aggregate a warning and determine whether to emit it.
| |
| aggregationNotes | back to summary |
|---|---|
| public List Build and return any accumulated aggregation notes. | |
| clear | back to summary |
|---|---|
| public void clear() | |
| Modifier and Type | Field and Description |
|---|---|
| public static final WarningAggregator. | ADDITIONAL_IN_FILE
This kind is used when a single specific file is found to have warnings and when similar warnings have already been reported for the file. |
| public static final WarningAggregator. | ADDITIONAL_IN_FILES
This kind is used when multiple files have been found to have warnings, and some of them have had already had specific similar warnings. |
| public static final WarningAggregator. | IN_FILE
This kind is used when a single specific file is found to have warnings and no similar warnings have already been given. |
| public static final WarningAggregator. | IN_FILES
This kind is used when multiple files have been found to have warnings, and none of them have had any similar warnings. |
| private final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv String | |
| public static WarningAggregator. | |
| public static WarningAggregator. |
| ADDITIONAL_IN_FILE | back to summary |
|---|---|
| public static final WarningAggregator. This kind is used when a single specific file is found to have warnings and when similar warnings have already been reported for the file. It generates a message like: FILE has additional ISSUES | |
| ADDITIONAL_IN_FILES | back to summary |
|---|---|
| public static final WarningAggregator. This kind is used when multiple files have been found to have warnings, and some of them have had already had specific similar warnings. It generates a message like: Some files have additional ISSUES | |
| IN_FILE | back to summary |
|---|---|
| public static final WarningAggregator. This kind is used when a single specific file is found to have warnings and no similar warnings have already been given. It generates a message like: FILE has ISSUES | |
| IN_FILES | back to summary |
|---|---|
| public static final WarningAggregator. This kind is used when multiple files have been found to have warnings, and none of them have had any similar warnings. It generates a message like: Some files have ISSUES | |
| value | back to summary |
|---|---|
| private final String value | |
| DeferredDiagnosticKind | back to summary |
|---|---|
| private DeferredDiagnosticKind(String v) | |
| getKey | back to summary |
|---|---|
| pack-priv String getKey(String prefix) | |
| valueOf | back to summary |
|---|---|
| public static WarningAggregator. | |
| values | back to summary |
|---|---|
| public static WarningAggregator. | |