Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 47083 invoked from network); 8 Nov 2006 10:32:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Nov 2006 10:32:50 -0000 Received: (qmail 74108 invoked by uid 500); 8 Nov 2006 10:32:58 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 74072 invoked by uid 500); 8 Nov 2006 10:32:58 -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 74063 invoked by uid 99); 8 Nov 2006 10:32:58 -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 02:32:58 -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.186 as permitted sender) Received: from [64.233.182.186] (HELO nf-out-0910.google.com) (64.233.182.186) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Nov 2006 02:32:42 -0800 Received: by nf-out-0910.google.com with SMTP id p46so462514nfa for ; Wed, 08 Nov 2006 02:32:21 -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=YNZeeR+aF9o5sw5if2fl8NYkZm/gbIJSYD8/l5Ki8x+7soIgIfDHSRPiEWv7xc+3lt0xulsv/H4HL6Bpe8vP3bLG4QyUex+AUwcCvPKxYZ2npW/iBDNRn7hbrqGbVpQHUSiQnb8mLA9kbriqmXgd8xxkNVffbXrO8utEg5GEO5M= Received: by 10.48.210.20 with SMTP id i20mr2021547nfg.1162981941199; Wed, 08 Nov 2006 02:32:21 -0800 (PST) Received: from ?9.20.183.69? ( [195.212.29.67]) by mx.google.com with ESMTP id n22sm336057nfc.2006.11.08.02.32.20; Wed, 08 Nov 2006 02:32:20 -0800 (PST) Message-ID: <4551B230.8090207@gmail.com> Date: Wed, 08 Nov 2006 10:32:16 +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: <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> <45519B18.8080607@gmail.com> <6e47b64f0611080112x2f9cd9bbl2fb8594000d19a89@mail.gmail.com> In-Reply-To: <6e47b64f0611080112x2f9cd9bbl2fb8594000d19a89@mail.gmail.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Stepan Mishura wrote: > On 11/8/06, Tim Ellison wrote: >> >> 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. > > IMO, if this piece of code may cause questions then it makes sense to add > comments above to the code. Just to avoid similar questions in future. Sheesh, you'll be asking me to log violations next ;-) You make a good point. Done in r472443. Regards, Tim -- Tim Ellison (t.p.ellison@gmail.com) IBM Java technology centre, UK.