You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by MORÁVEK Peter <mo...@pobox.sk> on 2000/03/20 16:58:02 UTC

StringTokenizer update

Hello,

I've found a bug in my implementation of StringTokenizer, the method
hasMoreTokens()
returned invalid value, if returnTokens=true and the last character in
string is token.
Here is an update to the implementation (just the update method):

  public boolean hasMoreTokens() {
    return ((current < max) ? (true) : 
      (((current == max) && (max == 0 
        || (returnTokens && delim.indexOf(str.charAt(previous)) >= 0)))));
  }

Sorry for my mistake ...

Peter