Skip to content

Commit a337fec

Browse files
committed
Merge branch 'master' of https://[email protected]/apache/commons-lang.git
2 parents 26d00b8 + 4824978 commit a337fec

File tree

7 files changed

+2421
-2645
lines changed

7 files changed

+2421
-2645
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ The <action> type attribute can be add,update,fix,remove.
5555
<action type="fix" dev="ggregory" due-to="Scott Parish">[javadoc] Strings::equalsAny: CI doc string should show it's insensitive #1416.</action>
5656
<action type="fix" dev="ggregory" due-to="Gary Gregory">Reduce spurious failures in org.apache.commons.lang3.ArrayUtilsTest methods that test ArrayUtils.shuffle() methods.</action>
5757
<action type="fix" dev="ggregory" due-to="Gary Gregory">General Javadoc improvements.</action>
58+
<action issue="LANG-1780" type="fix" dev="ggregory" due-to="tza">Fix Strings Javadoc #1419.</action>
5859
<!-- ADD -->
5960
<!-- UPDATE -->
6061
<action type="update" dev="ggregory" due-to="Gary Gregory">[test] Bump org.apache.commons:commons-text from 1.13.1 to 1.14.0.</action>

src/main/java/org/apache/commons/lang3/CharSequenceUtils.java

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -72,43 +72,38 @@ static int indexOf(final CharSequence cs, final CharSequence searchChar, final i
7272
}
7373

7474
/**
75-
* Returns the index within {@code cs} of the first occurrence of the
76-
* specified character, starting the search at the specified index.
75+
* Returns the index within {@code cs} of the first occurrence of the specified character, starting the search at the specified index.
7776
* <p>
78-
* If a character with value {@code searchChar} occurs in the
79-
* character sequence represented by the {@code cs}
80-
* object at an index no smaller than {@code start}, then
81-
* the index of the first such occurrence is returned. For values
82-
* of {@code searchChar} in the range from 0 to 0xFFFF (inclusive),
83-
* this is the smallest value <em>k</em> such that:
77+
* If a character with value {@code searchChar} occurs in the character sequence represented by the {@code cs} object at an index no smaller than
78+
* {@code start}, then the index of the first such occurrence is returned. For values of {@code searchChar} in the range from 0 to 0xFFFF (inclusive), this
79+
* is the smallest value <em>k</em> such that:
8480
* </p>
85-
* <blockquote><pre>
81+
*
82+
* <pre>
8683
* (this.charAt(<em>k</em>) == searchChar) &amp;&amp; (<em>k</em> &gt;= start)
87-
* </pre></blockquote>
88-
* is true. For other values of {@code searchChar}, it is the
89-
* smallest value <em>k</em> such that:
90-
* <blockquote><pre>
84+
* </pre>
85+
* <p>
86+
* is true. For other values of {@code searchChar}, it is the smallest value <em>k</em> such that:
87+
* </p>
88+
*
89+
* <pre>
9190
* (this.codePointAt(<em>k</em>) == searchChar) &amp;&amp; (<em>k</em> &gt;= start)
92-
* </pre></blockquote>
91+
* </pre>
9392
* <p>
94-
* is true. In either case, if no such character occurs inm {@code cs}
95-
* at or after position {@code start}, then
96-
* {@code -1} is returned.
93+
* is true. In either case, if no such character occurs inm {@code cs} at or after position {@code start}, then {@code -1} is returned.
9794
* </p>
9895
* <p>
99-
* There is no restriction on the value of {@code start}. If it
100-
* is negative, it has the same effect as if it were zero: the entire
101-
* {@link CharSequence} may be searched. If it is greater than
102-
* the length of {@code cs}, it has the same effect as if it were
103-
* equal to the length of {@code cs}: {@code -1} is returned.
96+
* There is no restriction on the value of {@code start}. If it is negative, it has the same effect as if it were zero: the entire {@link CharSequence} may
97+
* be searched. If it is greater than the length of {@code cs}, it has the same effect as if it were equal to the length of {@code cs}: {@code -1} is
98+
* returned.
10499
* </p>
105-
* <p>All indices are specified in {@code char} values
106-
* (Unicode code units).
100+
* <p>
101+
* All indices are specified in {@code char} values (Unicode code units).
107102
* </p>
108103
*
109-
* @param cs the {@link CharSequence} to be processed, not null
110-
* @param searchChar the char to be searched for
111-
* @param start the start index, negative starts at the string start
104+
* @param cs the {@link CharSequence} to be processed, not null
105+
* @param searchChar the char to be searched for
106+
* @param start the start index, negative starts at the string start
112107
* @return the index where the search char was found, -1 if not found
113108
* @since 3.6 updated to behave more like {@link String}
114109
*/
@@ -218,31 +213,33 @@ static int lastIndexOf(final CharSequence cs, final CharSequence searchChar, int
218213
}
219214

220215
/**
221-
* Returns the index within {@code cs} of the last occurrence of
222-
* the specified character, searching backward starting at the
223-
* specified index. For values of {@code searchChar} in the range
224-
* from 0 to 0xFFFF (inclusive), the index returned is the largest
225-
* value <em>k</em> such that:
226-
* <blockquote><pre>
216+
* Returns the index within {@code cs} of the last occurrence of the specified character, searching backward starting at the specified index. For values of
217+
* {@code searchChar} in the range from 0 to 0xFFFF (inclusive), the index returned is the largest value <em>k</em> such that:
218+
* </p>
219+
*
220+
* <pre>
227221
* (this.charAt(<em>k</em>) == searchChar) &amp;&amp; (<em>k</em> &lt;= start)
228-
* </pre></blockquote>
229-
* is true. For other values of {@code searchChar}, it is the
230-
* largest value <em>k</em> such that:
231-
* <blockquote><pre>
222+
* </pre>
223+
*
224+
* <p>
225+
* is true. For other values of {@code searchChar}, it is the largest value <em>k</em> such that:
226+
* <p>
227+
*
228+
* <pre>
232229
* (this.codePointAt(<em>k</em>) == searchChar) &amp;&amp; (<em>k</em> &lt;= start)
233-
* </pre></blockquote>
234-
* is true. In either case, if no such character occurs in {@code cs}
235-
* at or before position {@code start}, then {@code -1} is returned.
230+
* </pre>
236231
*
237232
* <p>
238-
* All indices are specified in {@code char} values
239-
* (Unicode code units).
233+
* is true. In either case, if no such character occurs in {@code cs} at or before position {@code start}, then {@code -1} is returned.
234+
* </p>
235+
* <p>
236+
* All indices are specified in {@code char} values (Unicode code units).
240237
* </p>
241238
*
242-
* @param cs the {@link CharSequence} to be processed
243-
* @param searchChar the char to be searched for
244-
* @param start the start index, negative returns -1, beyond length starts at end
245-
* @return the index where the search char was found, -1 if not found
239+
* @param cs the {@link CharSequence} to be processed.
240+
* @param searchChar the char to be searched for.
241+
* @param start the start index, negative returns -1, beyond length starts at end.
242+
* @return the index where the search char was found, -1 if not found.
246243
* @since 3.6 updated to behave more like {@link String}
247244
*/
248245
static int lastIndexOf(final CharSequence cs, final int searchChar, int start) {

0 commit comments

Comments
 (0)