Apache Solr open-source search software
LUCENE-1905: fix bug when instantiating SimpleFSLockFacory with a String and add test
Mark Robert Miller5bb97b264ef9
diff --git a/src/java/org/apache/lucene/store/SimpleFSLockFactory.java b/src/java/org/apache/lucene/store/SimpleFSLockFactory.javaindex 8aa26b43b1a..c6e97c73c9a 100755--- a/src/java/org/apache/lucene/store/SimpleFSLockFactory.java+++ b/src/java/org/apache/lucene/store/SimpleFSLockFactory.java@@ -77,8 +77,7 @@ public class SimpleFSLockFactory extends FSLockFactory {* @param lockDirName where lock files should be created.*/public SimpleFSLockFactory(String lockDirName) throws IOException {- lockDir = new File(lockDirName);- setLockDir(lockDir);+ setLockDir(new File(lockDirName));}public Lock makeLock(String lockName) {diff --git a/src/test/org/apache/lucene/store/TestLockFactory.java b/src/test/org/apache/lucene/store/TestLockFactory.javaindex cd9e5e6f789..a0206def9fc 100755--- a/src/test/org/apache/lucene/store/TestLockFactory.java+++ b/src/test/org/apache/lucene/store/TestLockFactory.java@@ -259,6 +259,11 @@ public class TestLockFactory extends LuceneTestCase {// Cleanup_TestUtil.rmDir(indexDirName);}++ public void testSimpleFSLockFactory() throws IOException {+ // test string file instantiation+ new SimpleFSLockFactory("test");+ }// Verify: setDisableLocks workspublic void testDisableLocks() throws IOException {