You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
StringUtils.chompLast throws StringIndexOutOfBoundsException when sep is longer than str #400
StringUtils.chompLast(@NonNull String str, @NonNull String sep) (line 853) computes str.substring(str.length() - sep.length()) at line 857. If sep is longer than str, the start index is negative, causing StringIndexOutOfBoundsException.
For example: chompLast("x", "ab") throws.
Fix: add a guard returning str when sep.length() > str.length().
Activity