From d8330064edec3c733f695ba8089fc503de71637d Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Thu, 8 Jan 2015 21:59:03 +0000 Subject: [PATCH] LUCENE-6169: Disable the fsync on directory assert for Java 9+, because in Java 9 opening a FileChannel on directory no longer works git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1650390 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/core/src/java/org/apache/lucene/util/IOUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lucene/core/src/java/org/apache/lucene/util/IOUtils.java b/lucene/core/src/java/org/apache/lucene/util/IOUtils.java index d6574baae6f..504b1f8ad08 100644 --- a/lucene/core/src/java/org/apache/lucene/util/IOUtils.java +++ b/lucene/core/src/java/org/apache/lucene/util/IOUtils.java @@ -407,7 +407,8 @@ public final class IOUtils { } if (isDir) { - assert (Constants.LINUX || Constants.MAC_OS_X) == false : + // TODO: LUCENE-6169 - Fix this assert once Java 9 problems are solved! + assert (Constants.LINUX || Constants.MAC_OS_X) == false || Constants.JRE_IS_MINIMUM_JAVA9 : "On Linux and MacOSX fsyncing a directory should not throw IOException, "+ "we just don't want to rely on that in production (undocumented). Got: " + exc; // Ignore exception if it is a directory