{
// check for invalid characters
if (Log.hasIllegalCharacters(value))
{
//Error for filter '{filter}'. The following characters are not valid: {Log.INVALID_CHARS}
LocalizedException ex = new LocalizedException();
ex.setMessage(INVALID_FILTER_CHARS, new Object[]{value, Log.INVALID_CHARS});
throw ex;
}
int index = value.indexOf("*");
if ((index >= 0) && (index != (value.length() - 1)))
{
//Error for filter '{filter}'. '*' must be the right most character.
LocalizedException ex = new LocalizedException();
ex.setMessage(INVALID_FILTER_STAR, new Object[]{value});
throw ex;
}
}