RFR 8058927: ATG throws ClassNotFoundException
Coleen Phillimore
coleen.phillimore at oracle.com
Tue Sep 30 16:05:11 UTC 2014
Hi David,
I already checked this in. Sorry to not wait until you weren't
traveling (but I was traveling myself).
On 9/26/14, 9:22 PM, David Holmes wrote:
> Sorry Coleen but I don't quite get the changes.
>
> javaClasses.cpp:
>
> 639 assert(class_loader() == k->class_loader(), "should be same");
>
> I can't quite get my head around the different things that k may be by
> the time we get to the assert, and its relation to the current class.
k is the current class. I added the assert because I could have taken
out the class_loader parameter to create_mirror, because we can get
class_loader out of the current class, but I didn't want to make the
change harder to merge since there have been a few changes in this area
lately.
> ---
>
> arrayKlass.cpp
>
> java_lang_Class::create_mirror(k, Handle(THREAD, k->class_loader()),
> Handle(NULL), CHECK);
>
> I expected to see something extracting the classloader of the element
> type here - but perhaps I'm misunderstanding what k represents.
The current class's class loader is already set to the classloader of
the element type. An assert to that effect here might have been useful.
>
> ---
>
> test/runtime/LoadClass/ShowClassLoader.java
>
> Sorry, my little 'test' program was really a demo. The actual test
> should be checking that for an array 'a':
>
> a.getClass().getClassLoader() ==
> a.getClass().getComponentType().getClassLoader()
>
> and for completeness it should test a primitive array, object array
> for a boot class, and object array for a non-boot class. So the test
> name should then be CheckArrayClassLoader.
Yes, that would have been a better test... and worth filing a bug to
improve it. I couldn't find a way to complain about the lack of this
test in the JCK tests, which I think would be better since my motivation
was to make this simply a regression test.
Thanks,
Coleen
>
> Thanks,
> David
>
> On 26/09/2014 12:05 PM, Coleen Phillimore wrote:
>>
>> Thanks for pointing out I cut/pasted the wrong webrevs. Here they are:
>>
>> open webrev at http://cr.openjdk.java.net/~coleenp/8058927/
>> bug link https://bugs.openjdk.java.net/browse/JDK-8058927
>>
>> Thanks,
>> Coleen
>>
>> On 9/25/14, 7:33 PM, Coleen Phillimore wrote:
>>> Summary: ClassLoader for array klass was set to null and not the class
>>> loader of the component type.
>>>
>>> open webrev at http://cr.openjdk.java.net/~coleenp/8058843
>>> bug link https://bugs.openjdk.java.net/browse/JDK-8058843
>>>
>>> See bug for more details.
>>>
>>> Ran testbase, jtreg and jck tests, not that they found this bug in the
>>> first place. Boris verified the fix with ATG.
>>>
>>> Thank you to David Holmes for finding it through visual inspection of
>>> the original change.
>>>
>>> Thanks,
>>> Coleen
>>
More information about the hotspot-runtime-dev
mailing list