felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r555615 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
Date Thu, 12 Jul 2007 12:44:26 GMT
Author: pauls
Date: Thu Jul 12 05:44:25 2007
New Revision: 555615

URL: http://svn.apache.org/viewvc?view=rev&rev=555615
Log:
Save some object creations in the ldap parser

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=555615&r1=555614&r2=555615
==============================================================================
--- 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 Thu
Jul 12 05:44:25 2007
@@ -1075,7 +1075,7 @@
                     }
                 }
 
-                operands.push((result) ? Boolean.TRUE : Boolean.FALSE);
+                operands.push(result ? Boolean.TRUE : Boolean.FALSE);
             }
             else
             {
@@ -1292,16 +1292,16 @@
         }
 
         // Determine class of LHS.
-        Class lhsClass = null;
+        Class lhsClass = lhs.getClass();
 
         // If LHS is an array, then call compare() on each element
         // of the array until a match is found.
-        if (lhs.getClass().isArray())
+        if (lhsClass.isArray())
         {
             // First, if this is an array of primitives, then convert
             // the entire array to an array of the associated
             // primitive wrapper class instances.
-            if (lhs.getClass().getComponentType().isPrimitive())
+            if (lhsClass.getComponentType().isPrimitive())
             {
                 lhs = convertPrimitiveArray(lhs);
             }
@@ -1330,9 +1330,6 @@
         }
         else
         {
-            // Get the class of LHS.
-            lhsClass = lhs.getClass();
-
             // At this point we are expecting the LHS to be a comparable,
             // but Boolean is a special case since it is the only primitive
             // wrapper class that does not implement comparable; deal with
@@ -1349,7 +1346,7 @@
                 try
                 {
                     Object rhsObject = lhsClass
-                        .getConstructor(new Class[] { String.class })
+                        .getConstructor(STRING_CLASS)
                             .newInstance(new Object[] { rhs });
                         return lhs.equals(rhsObject);
                 }



Mime
View raw message