-
Type:
Improvement
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 5.2.1
-
Component/s: core/store
-
Labels:None
-
Environment:
OS X, Linux
-
Lucene Fields:New, Patch Available
After upgrade from 4.1 to 5.2.1 I found that one of our test failed. Appeared the guilty was FSDirectory that converts given Path to Path.getRealPath. As result the test will fail:
Path p = Paths.get("/var/lucene_store");
FSDirectory d = new FSDirectory(p);
assertEquals(p.toString(), d.getDirectory().toString());
It because /var/lucene_store is a symlink and
Path directory =path.getRealPath();
resolves it to /private/var/lucene_store
I think this is bad design decision because "direcrory" isn't just internal state but is exposed in a public interface and "getDirectory()" is widely used to initialize other components.
It should use paths.getAbsolutePath() instead.
build and "ant test" were successful after fix.