[LANG-1406] StringIndexOutOfBoundsException in

StringUtils.replaceIgnoreCase

Fix dead store issue found by SpotBugs and enforce SpotBugs on CI
builds.
This commit is contained in:
Gary Gregory 2019-09-11 09:57:28 -04:00
parent 651c8f5c23
commit e7c6c5b66b
3 changed files with 2 additions and 4 deletions

View File

@ -32,4 +32,4 @@ jobs:
with:
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn -V apache-rat:check javadoc:javadoc -Ddoclint=all package --file pom.xml
run: mvn -V apache-rat:check spotbugs:check javadoc:javadoc -Ddoclint=all package --file pom.xml

View File

@ -32,4 +32,4 @@ script:
- mvn
after_success:
- mvn clean test jacoco:report coveralls:report -Ptravis-jacoco javadoc:javadoc -Ddoclint=all
- mvn clean test spotbugs:check jacoco:report coveralls:report -Ptravis-jacoco javadoc:javadoc -Ddoclint=all

View File

@ -6363,9 +6363,7 @@ public class StringUtils {
if (isEmpty(text) || isEmpty(searchString) || replacement == null || max == 0) {
return text;
}
String searchText = text;
if (ignoreCase) {
searchText = text.toLowerCase();
searchString = searchString.toLowerCase();
}
int start = 0;