java8 / Java8InAction

MIT License
3.19k stars 2.26k forks source link

Fix WordCounterSpliterator.tryAdvance #10

Open uprem opened 8 years ago

uprem commented 8 years ago

fixes:

  1. when initial string is empty, prevents throwing StringIndexOutOfBoundsException
  2. the last valid iteration return true. old code returns false for the last character which breaks tryAdvance() specs