You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Tim Ellison <t....@gmail.com> on 2006/11/07 21:44:03 UTC

[classlib] [suncompat] completion (was; Re: [classlib]Harmony classlib with J9 VM passes all the tests provided by JUnit4.1)

Nathan Beyer wrote:
> I believe we're down to agreeing to the Objects/Threads classes [1] in
> luni-kernel and getting them implemented in DRLVM and the donated IBM
> VM. I believe the Unsafe class needs to be re-implemented with these
> interfaces, but that may already be done.

yes, we are very close so should finish this off.

Also FYI, I was looking at our Unsafe I've just added a security check
and extra initialization.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Re: [classlib] [suncompat] completion (was; Re: [classlib]Harmony classlib with J9 VM passes all the tests provided by JUnit4.1)

Posted by Tim Ellison <t....@gmail.com>.
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.

Re: [classlib] [suncompat] completion (was; Re: [classlib]Harmony classlib with J9 VM passes all the tests provided by JUnit4.1)

Posted by Stepan Mishura <st...@gmail.com>.
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.

Thanks,
Stepan.

Regards,
> Tim
>
> --
>
> Tim Ellison (t.p.ellison@gmail.com)
> IBM Java technology centre, UK.
>



-- 
Stepan Mishura
Intel Middleware Products Division
------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Re: [classlib] [suncompat] completion (was; Re: [classlib]Harmony classlib with J9 VM passes all the tests provided by JUnit4.1)

Posted by Tim Ellison <t....@gmail.com>.
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.

Re: [classlib] [suncompat] completion (was; Re: [classlib]Harmony classlib with J9 VM passes all the tests provided by JUnit4.1)

Posted by Nathan Beyer <nb...@gmail.com>.
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?

thanks
-Nathan


On 11/7/06, Tim Ellison <t....@gmail.com> wrote:
> Nathan Beyer wrote:
> > I believe we're down to agreeing to the Objects/Threads classes [1] in
> > luni-kernel and getting them implemented in DRLVM and the donated IBM
> > VM. I believe the Unsafe class needs to be re-implemented with these
> > interfaces, but that may already be done.
>
> yes, we are very close so should finish this off.
>
> Also FYI, I was looking at our Unsafe I've just added a security check
> and extra initialization.
>
> Regards,
> Tim
>
> --
>
> Tim Ellison (t.p.ellison@gmail.com)
> IBM Java technology centre, UK.
>