diff options
author | Seth Tisue <seth@tisue.net> | 2015-08-28 14:29:25 -0400 |
---|---|---|
committer | Seth Tisue <seth@tisue.net> | 2015-08-28 14:29:25 -0400 |
commit | 4f35ab77e6b4456025facc63297e7f2e93c2b9d0 (patch) | |
tree | 706d2217e6fe8e4c41f781923eeaeeb83571400b /src | |
parent | 1fff4eb2cbb0c8e5c0313acb19919dca7ce3ffd4 (diff) | |
parent | b447e0f767079493acae46f5ba09b91aefa220c3 (diff) | |
download | scala-4f35ab77e6b4456025facc63297e7f2e93c2b9d0.tar.gz scala-4f35ab77e6b4456025facc63297e7f2e93c2b9d0.tar.bz2 scala-4f35ab77e6b4456025facc63297e7f2e93c2b9d0.zip |
Merge pull request #4712 from SethTisue/so-long-sun-misc-unsafe
SI-9381 remove last vestiges of sun.misc.Unsafe
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/concurrent/util/Unsafe.java | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/library/scala/concurrent/util/Unsafe.java b/src/library/scala/concurrent/util/Unsafe.java deleted file mode 100644 index 73739e377d..0000000000 --- a/src/library/scala/concurrent/util/Unsafe.java +++ /dev/null @@ -1,38 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.concurrent.util; -import java.lang.reflect.Field; - -// TODO: remove once akka no longer needs it, hopefully by 2.12.0-M3! -@Deprecated -public final class Unsafe { - @Deprecated - public final static sun.misc.Unsafe instance; - static { - try { - sun.misc.Unsafe found = null; - for(Field field : sun.misc.Unsafe.class.getDeclaredFields()) { - if (field.getType() == sun.misc.Unsafe.class) { - field.setAccessible(true); - found = (sun.misc.Unsafe) field.get(null); - break; - } - } - if (found == null) throw new IllegalStateException("Can't find instance of sun.misc.Unsafe"); - else instance = found; - } catch(Throwable t) { - throw new ExceptionInInitializerError(t); - } - } -} - -// Scala version: -// classOf[sun.misc.Unsafe].getDeclaredFields.filter(_.getType == classOf[sun.misc.Unsafe]).headOption.map { field => -// field.setAccessible(true); field.get(null).asInstanceOf[sun.misc.Unsafe] -// } getOrElse (throw new IllegalStateException("Can't find instance of sun.misc.Unsafe")) |