Modified approximate string comparison to be case insensitive.
git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@366506 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
index 61449c6..c271737 100644
--- a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
+++ b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
@@ -1479,7 +1479,8 @@
*
* Approximate for numerical values involves a difference of less than APPROX_CRITERIA
* Approximate for string values is calculated by using the Levenshtein distance
- * between strings. Less than APPROX_CRITERIA of difference is considered as approximate.
+ * between strings and is case insensitive. Less than APPROX_CRITERIA of
+ * difference is considered as approximate.
*
* Supported types only include the following subclasses of Number:
* - Byte
@@ -1551,7 +1552,8 @@
}
else if (obj1 instanceof String)
{
- int distance = getDistance(obj1.toString(),obj2.toString());
+ int distance = getDistance(
+ obj1.toString().toLowerCase(), obj2.toString().toLowerCase());
int size = ((String)obj1).length();
return (distance <= ((size*APPROX_CRITERIA)/100));
}