From c201eac291682a9bdb9ca2790403084b4f36da76 Mon Sep 17 00:00:00 2001 From: Mariot Chauvin Date: Tue, 10 Feb 2015 15:15:29 +0000 Subject: SI-8362: AbstractPromise extends AtomicReference To avoid `sun.misc.Unsafe`, which is not supported on Google App Engine. Deprecate `AbstractPromise` --> extend `j.u.c.atomic.AtomicReference` directly. `AtomicReference.compareAndSet()` should also provide better performance on HotSpot, which compiles it down to the machine's CAS instruction. The binary incompatible change is ok because it's in an internal package. I can't think of any real issue with adding a superclass (which contributes only final methods) to a class in an implementation package (as long as those methods were not introduced in any illicit subclasses of said class). Instead of changing `DefaultPromise`'s super class, let's be more conservative, and do it closest to the source. This is both clearer and more focussed, leaving those subclasses of AbstractPromise we never heard of unaffected. Genesis of the commit: since the work on `Future` performance, `AbstractPromise` is using `Unsafe`, breaking the ability for `Future` to be executed on GAE. At that time, viktorklang suggested to implement a fallback in case `Unsafe` is not available. carey proposed an implementation, and mchv submitted a patch, which was refined by adriaanm. --- bincompat-backward.whitelist.conf | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bincompat-backward.whitelist.conf') diff --git a/bincompat-backward.whitelist.conf b/bincompat-backward.whitelist.conf index a1706d103d..0d85590b41 100644 --- a/bincompat-backward.whitelist.conf +++ b/bincompat-backward.whitelist.conf @@ -208,6 +208,15 @@ filter { { matchName="scala.reflect.io.ZipArchive.scala$reflect$io$ZipArchive$$walkIterator" problemName=MissingMethodProblem + }, + // SI-8362: AbstractPromise extends AtomicReference + // It's ok to change a package-protected class in an impl package, + // even though it's not clear why it changed -- bug in generic signature generation? + // -public class scala.concurrent.impl.Promise$DefaultPromise extends scala.concurrent.impl.AbstractPromise implements scala.concurrent.impl.Promise + // +public class scala.concurrent.impl.Promise$DefaultPromise extends scala.concurrent.impl.AbstractPromise implements scala.concurrent.impl.Promise + { + matchName="scala.concurrent.impl.Promise$DefaultPromise" + problemName=MissingTypesProblem } ] } -- cgit v1.2.3