Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 22831 invoked from network); 8 Nov 2006 08:54:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Nov 2006 08:54:18 -0000 Received: (qmail 21526 invoked by uid 500); 8 Nov 2006 08:54:26 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 21313 invoked by uid 500); 8 Nov 2006 08:54:25 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 21304 invoked by uid 99); 8 Nov 2006 08:54:25 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Nov 2006 00:54:25 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of t.p.ellison@gmail.com designates 64.233.182.187 as permitted sender) Received: from [64.233.182.187] (HELO nf-out-0910.google.com) (64.233.182.187) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Nov 2006 00:54:10 -0800 Received: by nf-out-0910.google.com with SMTP id p46so437478nfa for ; Wed, 08 Nov 2006 00:53:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; b=tlXe9QAG1KDF6DLMWa0T1ngbPSrE1EOaUpszaj0MkpPpprFLkLMnPfPLlHW2cO3mExNsbXM1z2woJEtEcq3NQ7EwQPGpTEFSQA9fGoJmGHkPQ7/VYIR5+VqMMCByT4ZULd/VzNLfHRVE30eFB5sj2FtasTBJUi+zjE86r2guC5A= Received: by 10.49.29.2 with SMTP id g2mr1906637nfj.1162976028822; Wed, 08 Nov 2006 00:53:48 -0800 (PST) Received: from ?9.20.183.69? ( [195.212.29.67]) by mx.google.com with ESMTP id l27sm123282nfa.2006.11.08.00.53.48; Wed, 08 Nov 2006 00:53:48 -0800 (PST) Message-ID: <45519B18.8080607@gmail.com> Date: Wed, 08 Nov 2006 08:53:44 +0000 From: Tim Ellison User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [classlib] [suncompat] completion (was; Re: [classlib]Harmony classlib with J9 VM passes all the tests provided by JUnit4.1) References: <3b3f27c60611031750q5d4935deve0da79892c519271@mail.gmail.com> <454D2F1C.2020305@pobox.com> <454E75CF.4030806@gmail.com> <454E7DEF.6080906@pobox.com> <454F0807.2000902@gmail.com> <454F45F4.7040302@pobox.com> <3b3f27c60611061809j76d81ddclabb2da40a1799f53@mail.gmail.com> <4550F013.3060507@gmail.com> <3b3f27c60611072155w4f0ba3ebu6d451a9778586bd5@mail.gmail.com> In-Reply-To: <3b3f27c60611072155w4f0ba3ebu6d451a9778586bd5@mail.gmail.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Nathan Beyer wrote: > I just looked at the changes you made and have a question about this > snippet. > > + if (VM.callerClassLoader() != null) { > + throw new SecurityException("Unsafe"); > + } > > I just want to understand what this actually means. If the > 'callerClassLoader' is null, then the caller is the bootstrap class > loader, correct? Assuming that's correct, we're asserting that only > classes in the bootstrap class loader can call Unsafe, correct? Exactly, we are saying that only 'system' code (i.e. that on the bootclasspath) can get an instance of Unsafe because of the inherent dangers in the Unsafe APIs. It is then the responsibility of such system code not to release the instance of Unsafe to application code. Regards, Tim -- Tim Ellison (t.p.ellison@gmail.com) IBM Java technology centre, UK.