You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/11/14 07:54:30 UTC
[GitHub] [commons-lang] arturobernalg opened a new pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
arturobernalg opened a new pull request #649:
URL: https://github.com/apache/commons-lang/pull/649
…ment
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] arturobernalg commented on pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
Posted by GitBox <gi...@apache.org>.
arturobernalg commented on pull request #649:
URL: https://github.com/apache/commons-lang/pull/649#issuecomment-727163717
Hi @garydgregory @kinow
I have closed the other [PR](https://github.com/apache/commons-lang/pull/644) because by mistake I made the commit with my company email.
Regards
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on a change in pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #649:
URL: https://github.com/apache/commons-lang/pull/649#discussion_r523420805
##########
File path: src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
##########
@@ -375,6 +376,18 @@ public void testIndexOfAny_StringCharArray() {
assertEquals(-1, StringUtils.indexOfAny("ab", 'z'));
}
+
+ @DisplayName("testIndexOfAny_String")
Review comment:
I don't think we need to crowd the source with DisplayName here since it does not convey more information, give the test method a better name if needed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] arturobernalg commented on a change in pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #649:
URL: https://github.com/apache/commons-lang/pull/649#discussion_r523425768
##########
File path: src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
##########
@@ -375,6 +376,18 @@ public void testIndexOfAny_StringCharArray() {
assertEquals(-1, StringUtils.indexOfAny("ab", 'z'));
}
+
+ @DisplayName("testIndexOfAny_String")
Review comment:
OK, removed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] HubertWo commented on a change in pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
Posted by GitBox <gi...@apache.org>.
HubertWo commented on a change in pull request #649:
URL: https://github.com/apache/commons-lang/pull/649#discussion_r523411196
##########
File path: src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
##########
@@ -375,6 +376,18 @@ public void testIndexOfAny_StringCharArray() {
assertEquals(-1, StringUtils.indexOfAny("ab", 'z'));
}
+
+ @DisplayName("testIndexOfAny_String")
Review comment:
What's the purpose of having the same for ```@DisplayName``` and test name?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] arturobernalg commented on a change in pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #649:
URL: https://github.com/apache/commons-lang/pull/649#discussion_r523414958
##########
File path: src/main/java/org/apache/commons/lang3/StringUtils.java
##########
@@ -2854,6 +2854,39 @@ public static int indexOfAny(final CharSequence cs, final String searchChars) {
return indexOfAny(cs, searchChars.toCharArray());
}
+ /**
+ * <p>Search a CharSequence to find the first index of any
+ * character in the given set of characters starting with
+ * a given index.</p>
+ *
+ * <p>A {@code null} String will return {@code -1}.
+ * A {@code null} search string will return {@code -1}.</p>
+ *
+ * <pre>
+ * StringUtils.indexOfAny(null, 0, *) = -1
+ * StringUtils.indexOfAny("", 0, *) = -1
+ * StringUtils.indexOfAny(*, 0, null) = -1
+ * StringUtils.indexOfAny(*, 0, "") = -1
+ * StringUtils.indexOfAny("zzabyycdxx", 0, "za") = 0
+ * StringUtils.indexOfAny("zzabyycdxx", 0, "by") = 3
+ * StringUtils.indexOfAny("aba", 0, "z") = -1
+ * StringUtils.indexOfAny("aba", 1, "a") = 1
+ * StringUtils.indexOfAny("aba", -1, "a") = -1
+ * </pre>
+ *
+ * @param cs the CharSequence to check, may be null
+ * @param beginIndex the start position to search
+ * @param searchChars the chars to search for, may be null
+ * @return the index of any of the chars, -1 if no match,null input or the beginIndex smaller than 0
Review comment:
no clue about what do i need to fix
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] arturobernalg closed pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
Posted by GitBox <gi...@apache.org>.
arturobernalg closed pull request #649:
URL: https://github.com/apache/commons-lang/pull/649
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] HubertWo commented on a change in pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
Posted by GitBox <gi...@apache.org>.
HubertWo commented on a change in pull request #649:
URL: https://github.com/apache/commons-lang/pull/649#discussion_r523411196
##########
File path: src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
##########
@@ -375,6 +376,18 @@ public void testIndexOfAny_StringCharArray() {
assertEquals(-1, StringUtils.indexOfAny("ab", 'z'));
}
+
+ @DisplayName("testIndexOfAny_String")
Review comment:
What's the purpose of having the same ```@DisplayName``` and test name?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] arturobernalg commented on a change in pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #649:
URL: https://github.com/apache/commons-lang/pull/649#discussion_r523414790
##########
File path: src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
##########
@@ -375,6 +376,18 @@ public void testIndexOfAny_StringCharArray() {
assertEquals(-1, StringUtils.indexOfAny("ab", 'z'));
}
+
+ @DisplayName("testIndexOfAny_String")
Review comment:
Just get extra info https://junit.org/junit5/docs/5.0.3/api/org/junit/jupiter/api/DisplayName.html
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] arturobernalg commented on a change in pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #649:
URL: https://github.com/apache/commons-lang/pull/649#discussion_r523430277
##########
File path: src/main/java/org/apache/commons/lang3/StringUtils.java
##########
@@ -2854,6 +2854,39 @@ public static int indexOfAny(final CharSequence cs, final String searchChars) {
return indexOfAny(cs, searchChars.toCharArray());
}
+ /**
+ * <p>Search a CharSequence to find the first index of any
+ * character in the given set of characters starting with
+ * a given index.</p>
+ *
+ * <p>A {@code null} String will return {@code -1}.
+ * A {@code null} search string will return {@code -1}.</p>
+ *
+ * <pre>
+ * StringUtils.indexOfAny(null, 0, *) = -1
+ * StringUtils.indexOfAny("", 0, *) = -1
+ * StringUtils.indexOfAny(*, 0, null) = -1
+ * StringUtils.indexOfAny(*, 0, "") = -1
+ * StringUtils.indexOfAny("zzabyycdxx", 0, "za") = 0
+ * StringUtils.indexOfAny("zzabyycdxx", 0, "by") = 3
+ * StringUtils.indexOfAny("aba", 0, "z") = -1
+ * StringUtils.indexOfAny("aba", 1, "a") = 1
+ * StringUtils.indexOfAny("aba", -1, "a") = -1
+ * </pre>
+ *
+ * @param cs the CharSequence to check, may be null
+ * @param beginIndex the start position to search
+ * @param searchChars the chars to search for, may be null
+ * @return the index of any of the chars, -1 if no match,null input or the beginIndex smaller than 0
Review comment:
OK, I think it's already formatted
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] HubertWo commented on a change in pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
Posted by GitBox <gi...@apache.org>.
HubertWo commented on a change in pull request #649:
URL: https://github.com/apache/commons-lang/pull/649#discussion_r523411094
##########
File path: src/main/java/org/apache/commons/lang3/StringUtils.java
##########
@@ -2854,6 +2854,39 @@ public static int indexOfAny(final CharSequence cs, final String searchChars) {
return indexOfAny(cs, searchChars.toCharArray());
}
+ /**
+ * <p>Search a CharSequence to find the first index of any
+ * character in the given set of characters starting with
+ * a given index.</p>
+ *
+ * <p>A {@code null} String will return {@code -1}.
+ * A {@code null} search string will return {@code -1}.</p>
+ *
+ * <pre>
+ * StringUtils.indexOfAny(null, 0, *) = -1
+ * StringUtils.indexOfAny("", 0, *) = -1
+ * StringUtils.indexOfAny(*, 0, null) = -1
+ * StringUtils.indexOfAny(*, 0, "") = -1
+ * StringUtils.indexOfAny("zzabyycdxx", 0, "za") = 0
+ * StringUtils.indexOfAny("zzabyycdxx", 0, "by") = 3
+ * StringUtils.indexOfAny("aba", 0, "z") = -1
+ * StringUtils.indexOfAny("aba", 1, "a") = 1
+ * StringUtils.indexOfAny("aba", -1, "a") = -1
+ * </pre>
+ *
+ * @param cs the CharSequence to check, may be null
+ * @param beginIndex the start position to search
+ * @param searchChars the chars to search for, may be null
+ * @return the index of any of the chars, -1 if no match,null input or the beginIndex smaller than 0
Review comment:
Please fix formatting.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] HubertWo commented on a change in pull request #649: [LANG-1231] - StringUtils#indexOfAny() methods with start position argu…
Posted by GitBox <gi...@apache.org>.
HubertWo commented on a change in pull request #649:
URL: https://github.com/apache/commons-lang/pull/649#discussion_r523429429
##########
File path: src/main/java/org/apache/commons/lang3/StringUtils.java
##########
@@ -2854,6 +2854,39 @@ public static int indexOfAny(final CharSequence cs, final String searchChars) {
return indexOfAny(cs, searchChars.toCharArray());
}
+ /**
+ * <p>Search a CharSequence to find the first index of any
+ * character in the given set of characters starting with
+ * a given index.</p>
+ *
+ * <p>A {@code null} String will return {@code -1}.
+ * A {@code null} search string will return {@code -1}.</p>
+ *
+ * <pre>
+ * StringUtils.indexOfAny(null, 0, *) = -1
+ * StringUtils.indexOfAny("", 0, *) = -1
+ * StringUtils.indexOfAny(*, 0, null) = -1
+ * StringUtils.indexOfAny(*, 0, "") = -1
+ * StringUtils.indexOfAny("zzabyycdxx", 0, "za") = 0
+ * StringUtils.indexOfAny("zzabyycdxx", 0, "by") = 3
+ * StringUtils.indexOfAny("aba", 0, "z") = -1
+ * StringUtils.indexOfAny("aba", 1, "a") = 1
+ * StringUtils.indexOfAny("aba", -1, "a") = -1
+ * </pre>
+ *
+ * @param cs the CharSequence to check, may be null
+ * @param beginIndex the start position to search
+ * @param searchChars the chars to search for, may be null
+ * @return the index of any of the chars, -1 if no match,null input or the beginIndex smaller than 0
Review comment:
Examples: ```(searchChars )``` - space before closing bracket or ```ch,null input or the ``` - space after comma and double space.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org