@Override public DiagCollector getDiagCollector() { return protoModel.getDiagReporter().getDiagCollector(); }
public void reportError(LocationContext locationContext, String formatString, Object... args) { report(Kind.ERROR, locationContext, formatString, args); }
/** * Collects error messages. * * @param location the location of the original comment source * @param lineNum the line number where the error is detected * @param message the message describes the error */ private void collectError(LocationContext location, int lineNum, String message) { diagReporter.reportError(location, "(at document line %d) " + message, lineNum); }
LocationContext location) { if (!remove && !isSupportedIn(configVersion)) { diagReporter.reportError( location, "Feature %s not available in config version %s.", this, configVersion); diagReporter.reportWarning( location, "Enabling feature %s had no effect because the feature was already enabled.", diagReporter.reportWarning( location, "Disabling feature %s had no effect because the feature was already disabled.",
.getModel() .getDiagReporter() .getDiagSuppressor() .addSuppressionDirective(element, arg, element.getModel().getConfigAspects()); break; .getModel() .getDiagReporter() .reportError( ResolvedLocation.create(element.getLocation()), "resource instruction must be associated with a message declaration, but " .getModel() .getDiagReporter() .reportError( ResolvedLocation.create(element.getLocation()), INLINE_INSTRUCTION .getModel() .getDiagReporter() .reportError( ResolvedLocation.create(element.getLocation()), INLINE_INSTRUCTION .getModel() .getDiagReporter() .reportWarning( ResolvedLocation.create(element.getLocation()), "message '%s' is recursive and will not be inlined.",
@Override protected Object run() throws Exception { if (suppressAllWarnings) { model.getDiagReporter().getDiagSuppressor().suppressAllWarningsUnder(model); } // Establish stage. model.establishStage(Normalized.KEY); if (model.getDiagReporter().getDiagCollector().hasErrors()) { return null; } Service service = model.getNormalizedConfig(); return toBaselineString(service); }
@Override public boolean run(Model model) { int oldErrorCount = model.getDiagReporter().getDiagCollector().getErrorCount(); model .getDiagReporter() .report(Diag.error(location, "Cannot resolve api '%s'.", api.getName())); if (oldErrorCount == model.getDiagReporter().getDiagCollector().getErrorCount()) {
/** Helper to report a warning. */ public void warning(LocationContext locationContext, String message, Object... params) { String prefix = String.format(DIAG_PREFIX, validatorName); diagReporter.reportWarning(locationContext, prefix + message, params); }
/** * Set a filter for warnings based on regular expression for aspect name. Only warnings containing * the aspect name pattern are produced. */ public void setWarningFilter(@Nullable String aspectNamePattern) { // Add as a pattern to the model. model .getDiagReporter() .getDiagSuppressor() .addPattern(model, String.format("^(?!.*(%s)).*", aspectNamePattern)); }
this.experiments = experiments; this.diagResolver = new DiagReporter(diagCollector, diagSuppressor, this);
.getModel() .getDiagReporter() .getDiagSuppressor() .addSuppressionDirective(element, arg, element.getModel().getConfigAspects()); break; .getModel() .getDiagReporter() .reportError( ResolvedLocation.create(element.getLocation()), "resource instruction must be associated with a message declaration, but " .getModel() .getDiagReporter() .reportError( ResolvedLocation.create(element.getLocation()), INLINE_INSTRUCTION .getModel() .getDiagReporter() .reportError( ResolvedLocation.create(element.getLocation()), INLINE_INSTRUCTION .getModel() .getDiagReporter() .reportWarning( ResolvedLocation.create(element.getLocation()), "message '%s' is recursive and will not be inlined.",
model .getDiagReporter() .getDiagSuppressor() .addSuppressionDirective(model, suppressionDirective, model.getConfigAspects()); for (Diag diag : model.getDiagReporter().getDiagCollector().getDiags()) { printDiag(diag); if (!model.getDiagReporter().getDiagCollector().hasErrors() && result != null) {
@Override public boolean run(Model model) { int oldErrorCount = model.getDiagReporter().getDiagCollector().getErrorCount(); model .getDiagReporter() .report(Diag.error(location, "Cannot resolve api '%s'.", api.getName())); if (oldErrorCount == model.getDiagReporter().getDiagCollector().getErrorCount()) {
/** Helper to report a warning. */ public void warning(LocationContext locationContext, String message, Object... params) { String prefix = String.format(DIAG_PREFIX, validatorName); diagReporter.reportWarning(locationContext, prefix + message, params); }
LocationContext location) { if (!remove && !isSupportedIn(configVersion)) { diagReporter.reportError( location, "Feature %s not available in config version %s.", this, configVersion); diagReporter.reportWarning( location, "Enabling feature %s had no effect because the feature was already enabled.", diagReporter.reportWarning( location, "Disabling feature %s had no effect because the feature was already disabled.",
@Override protected void process() throws IOException { // Suppress all lint warnings if the flag is true. if (options.get(SUPPRESS_WARNINGS)) { model.getDiagReporter().getDiagSuppressor().suppressAllWarningsUnder(model); } // Generate the normalized config. model.establishStage(Normalized.KEY); }
this.experiments = experiments; this.diagResolver = new DiagReporter(diagCollector, diagSuppressor, this);
@Override public List<Diag> getDiags() { return model.getDiagReporter().getDiagCollector().getDiags(); } };
/** * Collects error messages. * * @param location the location of the original comment source * @param lineNum the line number where the error is detected * @param message the message describes the error */ private void collectError(LocationContext location, int lineNum, String message) { diagReporter.reportError(location, "(at document line %d) " + message, lineNum); }
public void reportWarning(LocationContext locationContext, String formatString, Object... args) { report(Kind.WARNING, locationContext, formatString, args); }