From 7bb906f020058846451731fe0f62e5bd2d132f9e Mon Sep 17 00:00:00 2001 From: Grant Ingersoll Date: Thu, 18 Feb 2010 19:26:31 +0000 Subject: [PATCH] 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 --- .../apache/solr/search/function/distance/DistanceUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/solr/search/function/distance/DistanceUtils.java b/src/java/org/apache/solr/search/function/distance/DistanceUtils.java index a57744b40f3..359bf6b74d8 100644 --- a/src/java/org/apache/solr/search/function/distance/DistanceUtils.java +++ b/src/java/org/apache/solr/search/function/distance/DistanceUtils.java @@ -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(); }