|
@@ -22,6 +22,8 @@
|
22
|
22
|
|
23
|
23
|
package com.dmdirc.util;
|
24
|
24
|
|
|
25
|
+import javax.annotation.Nonnull;
|
|
26
|
+
|
25
|
27
|
/**
|
26
|
28
|
* Utilities for dealing with strings.
|
27
|
29
|
*/
|
|
@@ -41,7 +43,7 @@ public final class StringUtils {
|
41
|
43
|
* the index of the first character beyond the end of the word. If the specified index is not
|
42
|
44
|
* contained within a word (i.e., is whitespace) then 0,0 is returned.
|
43
|
45
|
*/
|
44
|
|
- public static int[] indiciesOfWord(final CharSequence text, final int index) {
|
|
46
|
+ public static int[] indiciesOfWord(@Nonnull final CharSequence text, final int index) {
|
45
|
47
|
final int start = indexOfStartOfWord(text, index);
|
46
|
48
|
final int end = indexOfEndOfWord(text, index);
|
47
|
49
|
|
|
@@ -61,7 +63,7 @@ public final class StringUtils {
|
61
|
63
|
*
|
62
|
64
|
* @return Start index of the word surrounding the index
|
63
|
65
|
*/
|
64
|
|
- public static int indexOfStartOfWord(final CharSequence text, final int index) {
|
|
66
|
+ public static int indexOfStartOfWord(@Nonnull final CharSequence text, final int index) {
|
65
|
67
|
int start = index;
|
66
|
68
|
|
67
|
69
|
// Traverse backwards
|
|
@@ -83,7 +85,7 @@ public final class StringUtils {
|
83
|
85
|
*
|
84
|
86
|
* @return End index of the word surrounding the index
|
85
|
87
|
*/
|
86
|
|
- public static int indexOfEndOfWord(final CharSequence text, final int index) {
|
|
88
|
+ public static int indexOfEndOfWord(@Nonnull final CharSequence text, final int index) {
|
87
|
89
|
int end = index;
|
88
|
90
|
|
89
|
91
|
// And forwards
|