From f4b4a44c7cfff909ee83753d9b29b7443f211962 Mon Sep 17 00:00:00 2001 From: Nick Hill Date: Thu, 24 Oct 2019 23:42:30 -0700 Subject: [PATCH] Change javadoc of ByteBuf#indexOf(...) to match its behaviour (#9679) Motivation Currently doc != code and so one needs to change. Though behaviour as currently documented might be more intuitive, we don't want to break anyone so will adjust the doc instead. See #9503 for discussion. Modifications Correct the javadoc of indexOf(...) method in ByteBuf abstract class. Results Correct javadoc --- buffer/src/main/java/io/netty/buffer/ByteBuf.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/buffer/src/main/java/io/netty/buffer/ByteBuf.java b/buffer/src/main/java/io/netty/buffer/ByteBuf.java index 41aab726ef..20f2bb1c66 100644 --- a/buffer/src/main/java/io/netty/buffer/ByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/ByteBuf.java @@ -2060,11 +2060,14 @@ public abstract class ByteBuf implements ReferenceCounted, Comparable { /** * Locates the first occurrence of the specified {@code value} in this - * buffer. The search takes place from the specified {@code fromIndex} - * (inclusive) to the specified {@code toIndex} (exclusive). + * buffer. The search takes place from the specified {@code fromIndex} + * (inclusive) to the specified {@code toIndex} (exclusive). *

* If {@code fromIndex} is greater than {@code toIndex}, the search is - * performed in a reversed order. + * performed in a reversed order from {@code fromIndex} (exclusive) + * down to {@code toIndex} (inclusive). + *

+ * Note that the lower index is always included and higher always excluded. *

* This method does not modify {@code readerIndex} or {@code writerIndex} of * this buffer.