You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2016/12/16 21:38:50 UTC

lucene-solr:LUCENE-6989-v2: LUCENE-6989: Comments and final cleanup

Repository: lucene-solr
Updated Branches:
  refs/heads/LUCENE-6989-v2 ffc957fdb -> 64c6f3599


LUCENE-6989: Comments and final cleanup


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/64c6f359
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/64c6f359
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/64c6f359

Branch: refs/heads/LUCENE-6989-v2
Commit: 64c6f359949b62fe981255516ba2286c0adcc190
Parents: ffc957f
Author: Uwe Schindler <us...@apache.org>
Authored: Fri Dec 16 22:38:30 2016 +0100
Committer: Uwe Schindler <us...@apache.org>
Committed: Fri Dec 16 22:38:30 2016 +0100

----------------------------------------------------------------------
 .../src/java/org/apache/lucene/store/MMapDirectory.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/64c6f359/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java b/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
index fa2ed8d..0487400 100644
--- a/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
@@ -356,9 +356,9 @@ public class MMapDirectory extends FSDirectory {
         throw se;
       } catch (ReflectiveOperationException | RuntimeException e) {
         // *** sun.misc.Cleaner unmapping (Java 8) ***
-        final Class<?> unmappableBufferClass = Class.forName("java.nio.DirectByteBuffer");
+        final Class<?> directBufferClass = Class.forName("java.nio.DirectByteBuffer");
         
-        final Method m = unmappableBufferClass.getMethod("cleaner");
+        final Method m = directBufferClass.getMethod("cleaner");
         m.setAccessible(true);
         final MethodHandle directBufferCleanerMethod = lookup.unreflect(m);
         final Class<?> cleanerClass = directBufferCleanerMethod.type().returnType();
@@ -379,7 +379,7 @@ public class MMapDirectory extends FSDirectory {
         final MethodHandle noop = dropArguments(constant(Void.class, null).asType(methodType(void.class)), 0, cleanerClass);
         final MethodHandle unmapper = filterReturnValue(directBufferCleanerMethod, guardWithTest(nonNullTest, cleanMethod, noop))
             .asType(methodType(void.class, ByteBuffer.class));
-        return newBufferCleaner(unmappableBufferClass, unmapper);
+        return newBufferCleaner(directBufferClass, unmapper);
       }
     } catch (SecurityException se) {
       return "Unmapping is not supported, because not all required permissions are given to the Lucene JAR file: " + se +
@@ -394,10 +394,10 @@ public class MMapDirectory extends FSDirectory {
     assert Objects.equals(methodType(void.class, ByteBuffer.class), unmapper.type());
     return (String resourceDescription, ByteBuffer buffer) -> {
       if (!buffer.isDirect()) {
-        throw new IllegalArgumentException("Unmapping only works with direct buffers");
+        throw new IllegalArgumentException("unmapping only works with direct buffers");
       }
       if (!unmappableBufferClass.isInstance(buffer)) {
-        throw new IllegalArgumentException("ByteBuffer is not an instance of " + unmappableBufferClass.getName());
+        throw new IllegalArgumentException("buffer is not an instance of " + unmappableBufferClass.getName());
       }
       final Throwable error = AccessController.doPrivileged((PrivilegedAction<Throwable>) () -> {
         try {