fix #4227: unchecked cast to String instead of CharSequence