Index: lucene/src/java/org/apache/lucene/store/FSDirectory.java =================================================================== --- lucene/src/java/org/apache/lucene/store/FSDirectory.java (revision 1050777) +++ lucene/src/java/org/apache/lucene/store/FSDirectory.java (working copy) @@ -26,7 +26,6 @@ import java.security.NoSuchAlgorithmException; import java.util.Collection; -import java.util.Collections; import static java.util.Collections.synchronizedSet; import java.util.HashSet; import java.util.Set; @@ -162,10 +161,10 @@ * best implementation given the current environment. * The directory returned uses the {@link NativeFSLockFactory}. * - *
Currently this returns {@link NIOFSDirectory} - * on non-Windows JREs, {@link MMapDirectory} on 64-bit - * Sun Windows JREs, and {@link SimpleFSDirectory} for other - * JRes on Windows. It is highly recommended that you consult the + *
Currently this returns {@link MMapDirectory} for most Solaris + * and Windows 64-bit JREs, {@link NIOFSDirectory} for other + * non-Windows JREs, and {@link SimpleFSDirectory} for other + * JREs on Windows. It is highly recommended that you consult the * implementation's documentation for your platform before * using this method. * @@ -185,11 +184,11 @@ /** 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) { - if (MMapDirectory.UNMAP_SUPPORTED && Constants.JRE_IS_64BIT) - return new MMapDirectory(path, lockFactory); - else - return new SimpleFSDirectory(path, lockFactory); + if ((Constants.WINDOWS || Constants.SUN_OS) + && Constants.JRE_IS_64BIT && MMapDirectory.UNMAP_SUPPORTED) { + return new MMapDirectory(path, lockFactory); + } else if (Constants.WINDOWS) { + return new SimpleFSDirectory(path, lockFactory); } else { return new NIOFSDirectory(path, lockFactory); }