code: protected void showIndicatorsForComponent(final List<Diagnostic> diags, final int severity) {
  		InputModel model = getOrCreateComponentModel();
  		if (severity == Diagnostic.ERROR) {
  			model.errorDiagnostics.clear();
  		} else {
  			model.warningDiagnostics.clear();
  		}
  		UIContext uic = UIContextHolder.getCurrent();
  		for (int i = 0; i < diags.size(); i++) {
  			Diagnostic diagnostic = diags.get(i);
  			// NOTE: double equals because they must be the same instance.
  			if (diagnostic.getSeverity() == severity && uic == diagnostic.getContext() && this == diagnostic.getComponent()) {
  				if (severity == Diagnostic.ERROR) {
  					model.errorDiagnostics.add(diagnostic);
  				} else {
  					model.warningDiagnostics.add(diagnostic);
  				}
  			}
  		}
  	}
docs: Iterates over the {@link Diagnostic}s and finds the diagnostics that related to the current component.
  
  @param diags A List of Diagnostic objects.
  @param severity A Diagnostic severity code. e.g. {@link Diagnostic#ERROR}