java-tutorials/java-strings
Larry Chung 84ef2cd246 BAEL-2142 Code revision to WordIndexer and JUnit (#5484)
* Refactoring and Unit testing added based on Kevin Gilmore's advice of Sep 16, 2018

* Refactoring and Unit testing added based on Kevin Gilmore's advice of Sep 16, 2018

* Refactoring and Unit testing added based on Kevin Gilmore's advice of Sep 16, 2018

* Resolve merge conflict

Added dependency for org.passay and for org.apache.commons

* Create searching/WordIndexer.java

* Create WordIndexerUnitTest.java

* Updated in response to Kevin Gilmore's questions

"What happens if the string ends with the word you're searching for? Would the next iteration of the loop cause an error if index + wordLength is greater than the last position of the string? Be sure to test this scenario."

* Updated WordIndexer in response to Kevin Gilmore

Generally speaking, it's good practice to declare return types, parameters, variables using an interface rather than an implementation, if the interface is sufficient to satisfy the need. In this case, there's no reason you can't simply return a List of Integer. (Excellent point, fixed)

The two methods are identical. Isn't the first one supposed to be the naive approach? (It was a copy and paste error, fixed)

* saving changes...

* Update java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java

Co-Authored-By: codewarrior2000 <lpc34@columbia.edu>

* Update java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java

Co-Authored-By: codewarrior2000 <lpc34@columbia.edu>

* Update java-strings/src/test/java/com/baeldung/string/searching/WordIndexerUnitTest.java

Co-Authored-By: codewarrior2000 <lpc34@columbia.edu>

* Respond to Kevin Gilmore's code changes

* Debugging code change to JUnit
2018-10-26 21:06:48 -05:00
..
src BAEL-2142 Code revision to WordIndexer and JUnit (#5484) 2018-10-26 21:06:48 -05:00
README.md Merge pull request #5315 from eugenp/thombergs-patch-31-1 2018-10-18 21:17:06 +02:00
pom.xml BAEL-2142 Code revision to WordIndexer and JUnit (#5484) 2018-10-26 21:06:48 -05:00