lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r811974 - in /lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/tier: CartesianPolyFilterBuilder.java CartesianShapeFilter.java
Date Mon, 07 Sep 2009 02:12:04 GMT
Author: markrmiller
Date: Mon Sep  7 02:12:04 2009
New Revision: 811974

URL: http://svn.apache.org/viewvc?rev=811974&view=rev
Log:
LUCENE-1891: Spatial uses java util logging that causes needless minor work (multiple string
concat, a method call) due to not checking log level

Modified:
    lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
    lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianShapeFilter.java

Modified: lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java?rev=811974&r1=811973&r2=811974&view=diff
==============================================================================
--- lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
(original)
+++ lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
Mon Sep  7 02:12:04 2009
@@ -19,6 +19,7 @@
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.lucene.search.Filter;
@@ -90,8 +91,9 @@
     int scale = (int)Math.log10(tierVert);
     endY = new BigDecimal(endY).setScale(scale, RoundingMode.HALF_EVEN).doubleValue();
     startY = new BigDecimal(startY).setScale(scale, RoundingMode.HALF_EVEN).doubleValue();
-    log.fine("scale "+scale+" startX "+ startX + " endX "+endX +" startY "+ startY + " endY
"+ endY +" tierVert "+ tierVert);
-    
+    if(log.isLoggable(Level.FINE)) {
+      log.fine("scale "+scale+" startX "+ startX + " endX "+endX +" startY "+ startY + "
endY "+ endY +" tierVert "+ tierVert);
+    }
     double xInc = 1.0d / tierVert;
     xInc = new BigDecimal(xInc).setScale(scale, RoundingMode.HALF_EVEN).doubleValue();
     

Modified: lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianShapeFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianShapeFilter.java?rev=811974&r1=811973&r2=811974&view=diff
==============================================================================
--- lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianShapeFilter.java
(original)
+++ lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianShapeFilter.java
Mon Sep  7 02:12:04 2009
@@ -18,6 +18,7 @@
 
 import java.io.IOException;
 import java.util.List;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.lucene.index.IndexReader;
@@ -73,7 +74,9 @@
     }
     
     long end = System.currentTimeMillis();
-    log.fine("BoundaryBox Time Taken: "+ (end - start) + " found: "+bits.cardinality()+"
candidates");
+    if(log.isLoggable(Level.FINE)) {
+      log.fine("BoundaryBox Time Taken: "+ (end - start) + " found: "+bits.cardinality()+"
candidates");
+    }
     return bits;
   }
 }



Mime
View raw message