cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MORÁVEK Peter <mora...@pobox.sk>
Subject StringTokenizer update
Date Mon, 20 Mar 2000 15:58:02 GMT
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

Mime
View raw message