Affects: 5.3.26

Description: There seems to be a problem with the condition comparison logic in the compareTo method of the RequestConditionHolder class. The current implementation is inconsistent with the expected behavior described in the documentation. Specifically, when this.condition is null, the method returns 1 instead of the expected -1.

/**
 * Compare the request conditions held by the two RequestConditionHolder
 * instances after making sure the conditions are of the same type.
 * Or if one holder is empty, the other holder is preferred.
 */
@Override
public int compareTo(RequestConditionHolder other, HttpServletRequest request) {
    if (this.condition == null && other.condition == null) {
        return 0;
    }
    else if (this.condition == null) {
        return 1;
    }
    else if (other.condition == null) {
        return -1;
    }
    else {
        assertEqualConditionTypes(this.condition, other.condition);
        return this.condition.compareTo(other.condition, request);
    }
}

Expected Behavior: According to the documentation, if one RequestConditionHolder is empty (i.e., its condition is null), it should be considered a weaker condition, and the non-empty RequestConditionHolder should be preferred. Therefore, in the case where this.condition is null, the compareTo method should return -1 instead of 1.

Actual Behavior: The current implementation returns 1 when this.condition is null, which is inconsistent with the expected behavior described in the documentation.