LUCENE-6618: MMapDirectory.checkUnmapSupported is buggy

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1695859 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2015-08-14 11:24:09 +00:00
parent 2d7df11ab8
commit b745a9f608
2 changed files with 6 additions and 1 deletions

View File

@ -70,6 +70,9 @@ Bug Fixes
* LUCENE-6730: Hyper-parameter c is ignored in term frequency NormalizationH1.
(Ahmet Arslan via Robert Muir)
* LUCENE-6618: Properly set MMapDirectory.UNMAP_SUPPORTED when it is now allowed
by security policy. (Robert Muir)
Other
* LUCENE-6174: Improve "ant eclipse" to select right JRE for building.

View File

@ -167,7 +167,9 @@ public class MMapDirectory extends FSDirectory {
private static boolean checkUnmapSupported() {
try {
Class.forName("java.nio.DirectByteBuffer").getMethod("cleaner");
Class<?> clazz = Class.forName("java.nio.DirectByteBuffer");
Method method = clazz.getMethod("cleaner");
method.setAccessible(true);
return true;
} catch (Exception e) {
return false;