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/09 17:38:30 UTC

lucene-solr:branch_6x: LUCENE-6989: Fix Exception handling in MMapDirectory's unmap hack support code to work with Java 9's new InaccessibleObjectException that does not extend ReflectiveAccessException in Java 9.

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x ca428ce23 -> d00ab65dc


LUCENE-6989: Fix Exception handling in MMapDirectory's unmap hack support code to work with Java 9's new InaccessibleObjectException that does not extend ReflectiveAccessException in Java 9.


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

Branch: refs/heads/branch_6x
Commit: d00ab65dccbef7add8b433a338c2ec3cea980916
Parents: ca428ce
Author: Uwe Schindler <us...@apache.org>
Authored: Fri Dec 9 18:36:37 2016 +0100
Committer: Uwe Schindler <us...@apache.org>
Committed: Fri Dec 9 18:38:13 2016 +0100

----------------------------------------------------------------------
 lucene/CHANGES.txt                                              | 5 +++++
 lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d00ab65d/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index e583168..bc99d60 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -34,6 +34,11 @@ Bug Fixes
   the incoming automaton is a special case and throw a clearer
   exception than NullPointerException (Tom Mortimer via Mike McCandless)
 
+* LUCENE-6989: Fix Exception handling in MMapDirectory's unmap hack
+  support code to work with Java 9's new InaccessibleObjectException
+  that does not extend ReflectiveAccessException in Java 9.
+  (Uwe Schindler)
+
 Improvements
 
 * LUCENE-7532: Add back lost codec file format documentation

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d00ab65d/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 c0e3519..be08a16 100644
--- a/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
@@ -385,13 +385,13 @@ public class MMapDirectory extends FSDirectory {
           }
         }
       };
-    } catch (ReflectiveOperationException e) {
-      return "Unmapping is not supported on this platform, because internal Java APIs are not compatible to this Lucene version: " + e; 
     } catch (SecurityException e) {
       return "Unmapping is not supported, because not all required permissions are given to the Lucene JAR file: " + e +
           " [Please grant at least the following permissions: RuntimePermission(\"accessClassInPackage.sun.misc\"), " +
           "RuntimePermission(\"accessClassInPackage.jdk.internal.ref\"), and " +
           "ReflectPermission(\"suppressAccessChecks\")]";
+    } catch (ReflectiveOperationException | RuntimeException e) {
+      return "Unmapping is not supported on this platform, because internal Java APIs are not compatible to this Lucene version: " + e; 
     }
   }