You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by pa...@apache.org on 2007/05/06 22:07:32 UTC
svn commit: r535651 -
/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
Author: pauls
Date: Sun May 6 13:07:32 2007
New Revision: 535651
URL: http://svn.apache.org/viewvc?view=rev&rev=535651
Log:
BigInteger is present in foundation while BigDecimal might not be -- this changes the parser to take this into account.
Modified:
felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java?view=diff&rev=535651&r1=535650&r2=535651
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java Sun May 6 13:07:32 2007
@@ -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;