private int estimateBufferRequirement(Expression expr) {
            Object value;

            if (expr.isValueKnown() &&
                (value = expr.getValue()) instanceof String) {

                return ((String)value).length();
            }
            else if (expr instanceof ConcatenateExpression) {
                return estimateBufferRequirement((ConcatenateExpression)expr);
            }
            else {
                return LENGTH_ESTIMATE;
            }
        }