SOLR-1779: how about a proper fix this time, as last fix didn't account for spaces

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@911534 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Grant Ingersoll 2010-02-18 19:26:31 +00:00
parent 06e20d9795
commit 7bb906f020
1 changed files with 4 additions and 2 deletions

View File

@ -140,8 +140,9 @@ public class DistanceUtils {
while (start < end && externalVal.charAt(start) == ' ') start++;
while (end > start && externalVal.charAt(end - 1) == ' ') end--;
out[i] = externalVal.substring(start, end);
start = end + 1;
start = idx + 1;
end = externalVal.indexOf(',', start);
idx = end;
if (end == -1) {
end = externalVal.length();
}
@ -180,8 +181,9 @@ public class DistanceUtils {
while (start < end && externalVal.charAt(start) == ' ') start++;
while (end > start && externalVal.charAt(end - 1) == ' ') end--;
out[i] = Double.parseDouble(externalVal.substring(start, end));
start = end + 1;
start = idx + 1;
end = externalVal.indexOf(',', start);
idex = end;
if (end == -1) {
end = externalVal.length();
}