mirror of https://github.com/apache/lucene.git
LUCENE-1891: Spatial uses java util logging that causes needless minor work (multiple string concat, a method call) due to not checking log level
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@811974 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2570f92b46
commit
675af03c9b
|
@ -19,6 +19,7 @@ package org.apache.lucene.spatial.tier;
|
|||
|
||||
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 @@ public class CartesianPolyFilterBuilder {
|
|||
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();
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.lucene.spatial.tier;
|
|||
|
||||
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 @@ public class CartesianShapeFilter extends Filter {
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue