BigInteger is present in foundation while BigDecimal might not be -- this changes the parser to take this into account.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@535651 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java b/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
index 8934936..29c8ff3 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
@@ -63,15 +63,15 @@
// Criteria in % to accept something as approximate.
public static final int APPROX_CRITERIA = 10;
- // Flag indicating presense of BigInteger/Decimal.
- private static boolean m_hasBigNumbers = false;
+ // Flag indicating presense of BigDecimal.
+ private static boolean m_hasBigDecimal = false;
static
{
try
{
Class.forName("java.math.BigDecimal");
- m_hasBigNumbers = true;
+ m_hasBigDecimal = true;
}
catch (Exception ex)
{
@@ -1556,7 +1556,7 @@
int size = ((String)obj1).length();
return (distance <= ((size*APPROX_CRITERIA)/100));
}
- else if (m_hasBigNumbers && (obj1 instanceof BigInteger))
+ else if (obj1 instanceof BigInteger)
{
BigInteger value1 = (BigInteger)obj1;
BigInteger value2 = (BigInteger)obj2;
@@ -1567,7 +1567,7 @@
BigInteger high = value1.add(delta);
return (value2.compareTo(low) >= 0) && (value2.compareTo(high) <= 0);
}
- else if (m_hasBigNumbers && (obj1 instanceof BigDecimal))
+ else if (m_hasBigDecimal && (obj1 instanceof BigDecimal))
{
BigDecimal value1 = (BigDecimal)obj1;
BigDecimal value2 = (BigDecimal)obj2;