diff --git a/platform/util/src/com/intellij/util/text/CharArrayUtil.java b/platform/util/src/com/intellij/util/text/CharArrayUtil.java index 5396650ebcd0..8ab04ee87055 100644 --- a/platform/util/src/com/intellij/util/text/CharArrayUtil.java +++ b/platform/util/src/com/intellij/util/text/CharArrayUtil.java @@ -352,21 +352,11 @@ public class CharArrayUtil { /** * Tries to find index of given pattern at the given buffer. - *
- * Note: given'toIndex' value restricts examination to 'toIndex -1' value (exclusive).. I.e. invocation like below
- * doesn't find the match:
- * - * String buffer = "aab"; - * String pattern = "ab"; - * CharArrayUtil.indexOf(buffer, pattern, 0, buffer.length()); // right boundary is "aab".length() - 1 = 2 (exclusive) - *- * - * This is historical behavior and is not going to be changed in order to preserve backward compatibility. * * @param buffer characters buffer which contents should be checked for the given pattern * @param pattern target characters sequence to find at the given buffer * @param fromIndex start index (inclusive). Zero is used if given index is negative - * @param toIndex defines end index (exclusive) by the formula
'toIndex - 1'
+ * @param toIndex end index (exclusive)
* @return index of the given pattern at the given buffer if the match is found; -1 otherwise
*/
public static int indexOf(@NotNull CharSequence buffer, @NotNull CharSequence pattern, int fromIndex, final int toIndex) {