From a29ad6dae969036a9d4640cb57fa430954cac3e2 Mon Sep 17 00:00:00 2001 From: David Wayne Smiley Date: Tue, 13 Mar 2012 02:12:44 +0000 Subject: [PATCH] LUCENE-3795 removed SLF4J dependency by logging to java.util.logging instead git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene3795_lsp_spatial_module@1299954 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/modules/spatial/pom.xml.template | 10 -------- .../spatial/lib/slf4j-LICENSE-BSD_LIKE.txt | 21 ---------------- modules/spatial/lib/slf4j-NOTICE.txt | 25 ------------------- modules/spatial/lib/slf4j-api-1.6.1.jar | 2 -- .../spatial/util/ShapeFieldCacheProvider.java | 10 +++----- .../spatial/vector/TwoDoublesStrategy.java | 5 ---- .../lucene/spatial/StrategyTestCase.java | 5 ++-- 7 files changed, 6 insertions(+), 72 deletions(-) delete mode 100644 modules/spatial/lib/slf4j-LICENSE-BSD_LIKE.txt delete mode 100644 modules/spatial/lib/slf4j-NOTICE.txt delete mode 100644 modules/spatial/lib/slf4j-api-1.6.1.jar diff --git a/dev-tools/maven/modules/spatial/pom.xml.template b/dev-tools/maven/modules/spatial/pom.xml.template index 2069f7ac5e8..52fd534ff20 100644 --- a/dev-tools/maven/modules/spatial/pom.xml.template +++ b/dev-tools/maven/modules/spatial/pom.xml.template @@ -49,10 +49,6 @@ com.spatial4j spatial4j - - org.slf4j - slf4j-api - ${project.groupId} lucene-core @@ -68,12 +64,6 @@ lucene-analyzers-common ${project.version} - - ${project.groupId} - lucene-benchmark - ${project.version} - true - ${build-directory} diff --git a/modules/spatial/lib/slf4j-LICENSE-BSD_LIKE.txt b/modules/spatial/lib/slf4j-LICENSE-BSD_LIKE.txt deleted file mode 100644 index f5ecafa0074..00000000000 --- a/modules/spatial/lib/slf4j-LICENSE-BSD_LIKE.txt +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2004-2008 QOS.ch -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/modules/spatial/lib/slf4j-NOTICE.txt b/modules/spatial/lib/slf4j-NOTICE.txt deleted file mode 100644 index cf438946ad9..00000000000 --- a/modules/spatial/lib/slf4j-NOTICE.txt +++ /dev/null @@ -1,25 +0,0 @@ -========================================================================= -== SLF4J Notice -- http://www.slf4j.org/license.html == -========================================================================= - -Copyright (c) 2004-2008 QOS.ch -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/modules/spatial/lib/slf4j-api-1.6.1.jar b/modules/spatial/lib/slf4j-api-1.6.1.jar deleted file mode 100644 index 46d734aa603..00000000000 --- a/modules/spatial/lib/slf4j-api-1.6.1.jar +++ /dev/null @@ -1,2 +0,0 @@ -AnyObjectId[42e0ad0de7773da9b94b12f503deda7f5a506015] was removed in git history. -Apache SVN contains full history. \ No newline at end of file diff --git a/modules/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCacheProvider.java b/modules/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCacheProvider.java index 7f0c4e1aff5..1eff3c3be46 100644 --- a/modules/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCacheProvider.java +++ b/modules/spatial/src/java/org/apache/lucene/spatial/util/ShapeFieldCacheProvider.java @@ -21,15 +21,13 @@ import com.spatial4j.core.shape.Shape; import org.apache.lucene.index.*; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.util.BytesRef; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.WeakHashMap; - +import java.util.logging.Logger; public abstract class ShapeFieldCacheProvider { - static final Logger log = LoggerFactory.getLogger(ShapeFieldCacheProvider.class); + private Logger log = Logger.getLogger(getClass().getName()); // it may be a List or T WeakHashMap> sidx = new WeakHashMap>(); @@ -51,7 +49,7 @@ public abstract class ShapeFieldCacheProvider { } long startTime = System.currentTimeMillis(); - log.info("Building Cache [" + reader.maxDoc() + "]"); + log.fine("Building Cache [" + reader.maxDoc() + "]"); idx = new ShapeFieldCache(reader.maxDoc(),defaultSize); int count = 0; DocsEnum docs = null; @@ -76,7 +74,7 @@ public abstract class ShapeFieldCacheProvider { } sidx.put(reader, idx); long elapsed = System.currentTimeMillis() - startTime; - log.info("Cached: [" + count + " in " + elapsed + "ms] " + idx); + log.fine("Cached: [" + count + " in " + elapsed + "ms] " + idx); return idx; } } diff --git a/modules/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java b/modules/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java index 1b2ec51cbf3..151483b2d44 100644 --- a/modules/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java +++ b/modules/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java @@ -37,14 +37,9 @@ import org.apache.lucene.spatial.SpatialStrategy; import org.apache.lucene.spatial.util.CachingDoubleValueSource; import org.apache.lucene.spatial.util.NumericFieldInfo; import org.apache.lucene.spatial.util.ValueSourceFilter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class TwoDoublesStrategy extends SpatialStrategy { - static final Logger log = LoggerFactory.getLogger(TwoDoublesStrategy.class); - private final NumericFieldInfo finfo; private final DoubleParser parser; diff --git a/modules/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java b/modules/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java index a0248dc68c4..6b6833b5697 100644 --- a/modules/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java +++ b/modules/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java @@ -28,12 +28,11 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexableField; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.InputStream; import java.util.*; +import java.util.logging.Logger; public abstract class StrategyTestCase extends SpatialTestCase { @@ -48,7 +47,7 @@ public abstract class StrategyTestCase extends Spati public static final String QTEST_Cities_IsWithin_BBox = "cities-IsWithin-BBox.txt"; - protected final Logger log = LoggerFactory.getLogger(getClass()); + private Logger log = Logger.getLogger(getClass().getName()); protected final SpatialArgsParser argsParser = new SpatialArgsParser();