code: public static boolean updateComponentError(AbstractComponent component, ErrorMessage error) {
  
          if (component.getComponentError() != error) {
              component.setComponentError(error);
              return true;
          }
          return false;
      }
docs: Updates the component error of a component, but only if it differs from the currently set
  error.<p>
  
  @param component the component
  @param error the error
  
  @return true if the error was changed