Probable bug in UserError Content Type


I’m using vaadin 6.7.4 (same in 6.7.6 as I check the repos). I have a situation where I have an error displayed on the form. I’m controlling the content displayed. In this situation I want to add a url link to the error that the user can click to take them to another webpage. According to the docs I should be able to do:

String returnMsg = "You have entered an incorrect email or password. Please check your details and try again. " +
“Click <a href="” + lostPasswordUrl + “">here if you have lost or forgotten your password”;
UserError errorMsg = new UserError(returnMsg, UserError.CONTENT_XHTML, UserError.ERROR);

However this does not work. When I check the code I find:

public static final int CONTENT_XHTML = 3;
public UserError(String message, int contentMode, int errorLevel) {

    // Check the parameters
    if (contentMode < 0 || contentMode > 2) {
        throw new java.lang.IllegalArgumentException(
                "Unsupported content mode: " + contentMode);

    msg = message;
    mode = contentMode;
    level = errorLevel;

I believe that that should be contentMode>3. Is this a bug? Or is there a reason this isn’t allowed?


Created ticket
about this.