mirror of
https://github.com/corda/corda.git
synced 2025-01-27 22:59:54 +00:00
StringTokenizer bugfixes
This commit is contained in:
parent
e9cafcad37
commit
8377016b0f
@ -31,10 +31,14 @@ public class StringTokenizer implements Enumeration {
|
||||
boolean sawNonDelimiter = false;
|
||||
for (int i = position; i < in.length(); ++i) {
|
||||
if (isDelimiter(in.charAt(i))) {
|
||||
if (includeDelimiters || sawNonDelimiter) {
|
||||
if (sawNonDelimiter) {
|
||||
sawNonDelimiter = false;
|
||||
++ count;
|
||||
}
|
||||
|
||||
if (includeDelimiters) {
|
||||
++ count;
|
||||
}
|
||||
sawNonDelimiter = false;
|
||||
} else {
|
||||
sawNonDelimiter = true;
|
||||
}
|
||||
@ -69,7 +73,7 @@ public class StringTokenizer implements Enumeration {
|
||||
}
|
||||
} else {
|
||||
position = i;
|
||||
while (position < in.length() && ! isDelimiter(in.charAt(i))) {
|
||||
while (position < in.length() && ! isDelimiter(in.charAt(position))) {
|
||||
++ position;
|
||||
}
|
||||
return in.substring(i, position);
|
||||
|
Loading…
x
Reference in New Issue
Block a user