if ((result.length() >= 2) && result.startsWith("'") && result.endsWith("'"))
if ((result.length() > 2) && result.startsWith("'") && result.endsWith("'"))
    protected String unescape(String text, String unescaped, String escaped)    {        String result = text;        // we need special handling if the single quote is escaped via a double single quote        if (result != null)        {            if (escaped.equals("''"))            {                if ((result.length() >= 2) && result.startsWith("'") && result.endsWith("'"))                {                    result = "'" + StringUtils.replace(result.substring(1, result.length() - 1), escaped, unescaped) + "'";                }                else                {                    result = StringUtils.replace(result, escaped, unescaped);                }            }            else            {                result = StringUtils.replace(result, escaped, unescaped);            }        }        return result;    }