/**
   * Updates values in DataElementAttributes to the given report parameter.
   *
   * @param dataAttrs the latest data element attributes
   * @param cachedDataAttrs the cached data element attributes
   * @param reportParam the report parameter
   * @throws SemanticException
   */
  private void updateDataElementAttrsToReportParam(
      DataElementAttributes dataAttrs,
      DataElementAttributes cachedDataAttrs,
      AbstractScalarParameterHandle reportParam)
      throws SemanticException {

    if (dataAttrs == null) return;

    boolean allowsNull = dataAttrs.allowsNull();
    if (cachedDataAttrs == null || cachedDataAttrs.allowsNull() != allowsNull)
      setReportParamIsRequired(reportParam, ALLOW_NULL_PROP_NAME, dataAttrs.allowsNull());

    // reportParam.setAllowNull( dataAttrs.allowsNull( ) );

    DataElementUIHints dataUiHints = dataAttrs.getUiHints();
    DataElementUIHints cachedDataUiHints =
        (cachedDataAttrs == null ? null : cachedDataAttrs.getUiHints());
    if (dataUiHints != null) {
      String displayName = dataUiHints.getDisplayName();
      String cachedDisplayName =
          cachedDataUiHints == null ? null : cachedDataUiHints.getDisplayName();

      boolean isChanged = false;

      if (cachedDisplayName == null || !cachedDisplayName.equals(displayName)) {
        isChanged = true;
        reportParam.setPromptText(displayName);
        reportParam.setPromptTextID(dataUiHints.getDisplayNameKey());
      }
      if (!isChanged && cachedDataUiHints != null && cachedDisplayName != null) {
        reportParam.setPromptText(cachedDisplayName);
        reportParam.setPromptTextID(cachedDataUiHints.getDisplayNameKey());
      }

      isChanged = false;
      String description = dataUiHints.getDescription();
      String cachedDescription =
          cachedDataUiHints == null ? null : cachedDataUiHints.getDescription();
      if (cachedDescription == null || !cachedDescription.equals(description)) {
        isChanged = true;
        reportParam.setHelpText(description);
        reportParam.setHelpTextKey(dataUiHints.getDescriptionKey());
      }

      if (!isChanged && cachedDataUiHints != null && cachedDescription != null) {
        reportParam.setHelpText(cachedDescription);
        reportParam.setHelpTextKey(cachedDataUiHints.getDescriptionKey());
      }
    }
  }