ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [26/51] [abbrv] ignite git commit: HashMap's offset retrieval in HashSet class definition for legacy IBM JRE
Date Wed, 09 Dec 2015 11:24:08 GMT
HashMap's offset retrieval in HashSet class definition for legacy IBM JRE


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

Branch: refs/heads/ignite-843-rc2
Commit: c077522038d050aac35ce034cc86d9af7959ebd5
Parents: ebddcb1
Author: Denis Magda <dmagda@gridgain.com>
Authored: Mon Dec 7 20:52:00 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Mon Dec 7 20:52:00 2015 +0300

----------------------------------------------------------------------
 .../optimized/OptimizedMarshallerUtils.java         | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c0775220/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
index 4d6afe6..da92b90 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
@@ -155,12 +155,22 @@ class OptimizedMarshallerUtils {
     static final JdkMarshaller JDK_MARSH = new JdkMarshaller();
 
     static {
+        long mapOff;
+
         try {
-            HASH_SET_MAP_OFF = UNSAFE.objectFieldOffset(HashSet.class.getDeclaredField("map"));
+            mapOff = UNSAFE.objectFieldOffset(HashSet.class.getDeclaredField("map"));
         }
         catch (NoSuchFieldException e) {
-            throw new IgniteException("Initialization failure.", e);
+            try {
+                // Workaround for legacy IBM JRE.
+                mapOff = UNSAFE.objectFieldOffset(HashSet.class.getDeclaredField("backingMap"));
+            }
+            catch (NoSuchFieldException e2) {
+                throw new IgniteException("Initialization failure.", e2);
+            }
         }
+
+        HASH_SET_MAP_OFF = mapOff;
     }
 
     /**
@@ -537,4 +547,4 @@ class OptimizedMarshallerUtils {
     static void setObject(Object obj, long off, Object val) {
         UNSAFE.putObject(obj, off, val);
     }
-}
\ No newline at end of file
+}


Mime
View raw message