lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject [1/2] lucene-solr:branch_6_3: LUCENE-7135: work around security manager when checking for 32/64 bit JVM
Date Wed, 02 Nov 2016 08:56:44 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6_3 1fe1a54db -> 3366219c6


LUCENE-7135: work around security manager when checking for 32/64 bit JVM


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

Branch: refs/heads/branch_6_3
Commit: 08526f581edef098cd94e899beef2a0fff95535c
Parents: 1fe1a54
Author: Mike McCandless <mikemccand@apache.org>
Authored: Sun Oct 30 20:04:37 2016 -0400
Committer: Mike McCandless <mikemccand@apache.org>
Committed: Wed Nov 2 04:43:12 2016 -0400

----------------------------------------------------------------------
 lucene/CHANGES.txt                                |  4 ++++
 .../java/org/apache/lucene/util/Constants.java    | 18 ++++++++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/08526f58/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index aebfa59..981e876 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -59,6 +59,10 @@ Bug Fixes
 * LUCENE-7429: AnalyzerWrapper can now modify the normalization chain too and
   DelegatingAnalyzerWrapper does the right thing automatically. (Adrien Grand)
 
+* Lucene's check for 32 or 64 bit JVM now works around security
+  manager blocking access to some properties (Aaron Madlon-Kay via
+  Mike McCandless)
+
 Improvements
 
 * LUCENE-7439: FuzzyQuery now matches all terms within the specified

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/08526f58/lucene/core/src/java/org/apache/lucene/util/Constants.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/Constants.java b/lucene/core/src/java/org/apache/lucene/util/Constants.java
index 7df0efc..e6a9609 100644
--- a/lucene/core/src/java/org/apache/lucene/util/Constants.java
+++ b/lucene/core/src/java/org/apache/lucene/util/Constants.java
@@ -68,15 +68,17 @@ public final class Constants {
       JVM_MINOR_VERSION = 0;
     }
     boolean is64Bit = false;
-    final String x = System.getProperty("sun.arch.data.model");
-    if (x != null) {
-      is64Bit = x.contains("64");
-    } else {
-      if (OS_ARCH != null && OS_ARCH.contains("64")) {
-        is64Bit = true;
-      } else {
-        is64Bit = false;
+    String datamodel = null;
+    try {
+      datamodel = System.getProperty("sun.arch.data.model");
+      if (datamodel != null) {
+        is64Bit = datamodel.contains("64");
       }
+    } catch (SecurityException ex) {}
+    if (datamodel == null && OS_ARCH != null && OS_ARCH.contains("64")) {
+      is64Bit = true;
+    } else {
+      is64Bit = false;
     }
     JRE_IS_64BIT = is64Bit;
   }


Mime
View raw message