Skip to content

Commit 0576fd5

Browse files
committed
Handle NCDFE for odd envs like GAE that throw it for Unsafe.
Fixes #2304.
1 parent 81879f1 commit 0576fd5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/main/java/org/jruby/util/unsafe/UnsafeHolder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ private static sun.misc.Unsafe loadUnsafe() {
5050
return (sun.misc.Unsafe) f.get(null);
5151
} catch (Exception e) {
5252
return null;
53+
} catch (NoClassDefFoundError ncdfe) {
54+
// Google AppEngine raises NCDFE for Unsafe rather than CNFE
55+
return null;
5356
}
5457
}
5558

0 commit comments

Comments
 (0)