mirror of https://github.com/apache/lucene.git
SOLR-1779: handle all spaces between a comma properly
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@911574 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7bb906f020
commit
74f73a3a71
|
@ -139,6 +139,9 @@ public class DistanceUtils {
|
||||||
for (; i < dimension; i++) {
|
for (; i < dimension; i++) {
|
||||||
while (start < end && externalVal.charAt(start) == ' ') start++;
|
while (start < end && externalVal.charAt(start) == ' ') start++;
|
||||||
while (end > start && externalVal.charAt(end - 1) == ' ') end--;
|
while (end > start && externalVal.charAt(end - 1) == ' ') end--;
|
||||||
|
if (start == end){
|
||||||
|
break;
|
||||||
|
}
|
||||||
out[i] = externalVal.substring(start, end);
|
out[i] = externalVal.substring(start, end);
|
||||||
start = idx + 1;
|
start = idx + 1;
|
||||||
end = externalVal.indexOf(',', start);
|
end = externalVal.indexOf(',', start);
|
||||||
|
@ -180,6 +183,9 @@ public class DistanceUtils {
|
||||||
//TODO: abstract common code with other parsePoint
|
//TODO: abstract common code with other parsePoint
|
||||||
while (start < end && externalVal.charAt(start) == ' ') start++;
|
while (start < end && externalVal.charAt(start) == ' ') start++;
|
||||||
while (end > start && externalVal.charAt(end - 1) == ' ') end--;
|
while (end > start && externalVal.charAt(end - 1) == ' ') end--;
|
||||||
|
if (start == end){
|
||||||
|
break;
|
||||||
|
}
|
||||||
out[i] = Double.parseDouble(externalVal.substring(start, end));
|
out[i] = Double.parseDouble(externalVal.substring(start, end));
|
||||||
start = idx + 1;
|
start = idx + 1;
|
||||||
end = externalVal.indexOf(',', start);
|
end = externalVal.indexOf(',', start);
|
||||||
|
|
Loading…
Reference in New Issue