diff -r 2c9bfffb1b71 -r bb26c50aadd0 hotspot/src/share/vm/ci/ciField.cpp --- a/hotspot/src/share/vm/ci/ciField.cpp Wed Jun 17 16:22:38 2015 +0300 +++ b/hotspot/src/share/vm/ci/ciField.cpp Mon Jun 15 15:27:04 2015 +0300 @@ -186,6 +186,10 @@ // Even if general trusting is disabled, trust system-built closures in these packages. if (holder->is_in_package("java/lang/invoke") || holder->is_in_package("sun/invoke")) return true; + // Trust VM anonymous classes. They are private API (sun.misc.Unsafe) and can't be serialized, + // so there is no hacking of finals going on with them. + if (holder->is_anonymous()) + return true; return TrustFinalNonStaticFields; }