Below code is added in Spring 5.2.12 for AbstractDataBoundFormElementTag.resolveId(), and it is marked as, this method can return null value.

Is it really possible that this method will return null in any scenario? Because at the end, it will auto generate id based on property path.

    @Nullable
    protected String resolveId() throws JspException {
        Object id = evaluate("id", getId());
        if (id != null) {
            String idString = id.toString();
            return (StringUtils.hasText(idString) ? idString : null);
        }
        return autogenerateId();
    }

Comment From: sbrannen

Yes, the return value can be null.

If the object returned from evaluate(String,Object) is non-null but has a toString() result that "does not have text", resolveId() will return null.

Furthermore, autogenerateId() can also return null.