[9] RFR 8072369: [TESTBUG] Remove potentially insecure class cast in some hotspot tests

Vladimir Kozlov vladimir.kozlov at oracle.com
Wed Oct 7 03:11:46 UTC 2015


On 10/7/15 3:35 AM, Christian Thalinger wrote:
>
>> On Sep 9, 2015, at 3:16 AM, Konstantin Shefov
>> <konstantin.shefov at oracle.com <mailto:konstantin.shefov at oracle.com>>
>> wrote:
>>
>> Description of the fix.
>> Some tests in hotspot repo use class cast from Application class
>> loader to URLClassLoader, but Application class loader is not
>> guaranteed to be always an instance of a URLClassLoader.
>
> Please excuse my lack of knowledge here but in what configuration does
> this happen?

Based on bug report it is sun.misc.Launcher$AppClassLoader.

Duplication of 'parent':

+     * @param parent parent class loader

Why do you need import next in each test? Is not enough to import them 
to Utils.java only?:
+import java.io.File;
+import java.net.URL;

Thanks,
Vladimir

>
>> The tests should be changed so that they do not cast appclassloader to
>> URLClassLoader.
>>
>> -Konstantin
>>
>> On 09/08/2015 07:01 PM, Konstantin Shefov wrote:
>>> Hello
>>>
>>> Please review a test bug fix.
>>>
>>> JBS entry: https://bugs.openjdk.java.net/browse/JDK-8072369
>>> Webrev: http://cr.openjdk.java.net/~kshefov/8072369/webrev.00
>>>
>>> Thanks
>>> -Konstantin
>>
>


More information about the hotspot-compiler-dev mailing list