diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 30af545521c..b26e1cb50a7 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -232,6 +232,9 @@ Optimizations implementations. This improves random access as used by docvalues codecs if used with MMapDirectory. (Robert Muir, Uwe Schindler) +* LUCENE-5730: FSDirectory.open returns MMapDirectory for 64-bit operating + systems, not just Linux and Windows. (Robert Muir) + Bug fixes * LUCENE-5673: MMapDirectory: Work around a "bug" in the JDK that throws diff --git a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java index 2cbde59b6da..ed7968ab803 100644 --- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java +++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java @@ -167,8 +167,7 @@ public abstract class FSDirectory extends BaseDirectory { /** Just like {@link #open(File)}, but allows you to * also specify a custom {@link LockFactory}. */ public static FSDirectory open(File path, LockFactory lockFactory) throws IOException { - if ((Constants.WINDOWS || Constants.SUN_OS || Constants.LINUX) - && Constants.JRE_IS_64BIT && MMapDirectory.UNMAP_SUPPORTED) { + if (Constants.JRE_IS_64BIT && MMapDirectory.UNMAP_SUPPORTED) { return new MMapDirectory(path, lockFactory); } else if (Constants.WINDOWS) { return new SimpleFSDirectory(path, lockFactory);