[9] RFR (S) 6191224: (reflect) Misleading detail string in IllegalArgumentException thrown by Array.get<Type>
Chris Plummer
chris.plummer at oracle.com
Thu Oct 9 05:27:57 UTC 2014
On 10/8/14 9:06 PM, David Holmes wrote:
> Hi Chris,
>
> Functional fix looks fine.
>
> Continuing with the analysis of the test ...
>
> On 9/10/2014 12:40 PM, Christian Tornqvist wrote:
>> Hi Chris,
>>
>> First of all, thanks for writing a regression test :)
>>
>> The naming of the test should follow the Hotspot test naming guidelines
>> (https://wiki.openjdk.java.net/display/HotSpot/Naming+HotSpot+JTReg+Tests).
>>
>
> Christian: Some guidance would help here - the wiki page states "It is
> up to each group to organize the file structure within the
> corresponding component folder" - so what are our actual naming
> guidelines? Would this be an Array test? Reflection test? Exception
> test? Or something else?
>
>>> 28 * @run main/othervm Test6191224
>> Is there a reason you need to run it with /othervm?
>>
>> When the test fails you should throw an exception instead of calling
>> System.exit(), jtreg doesn't like System.exit
>> (http://openjdk.java.net/jtreg/faq.html#question2.6)
>
> Also the coding conventions for Java code include:
>
> - opening braces are at the end of the statement not on a line by
> themselves
> - indent is 4 spaces
I'm fighting xemacs on this one. Doesn't seem to want to handle C and
Java differently. I'll look for a solution.
Chris
>
> (Is that on a wiki somewhere?)
>
> Thanks,
> David
>
>> Thanks,
>> Christian
>>
>>
>> -----Original Message-----
>> From: hotspot-runtime-dev
>> [mailto:hotspot-runtime-dev-bounces at openjdk.java.net] On Behalf Of Chris
>> Plummer
>> Sent: Wednesday, October 8, 2014 8:08 PM
>> To: hotspot-runtime-dev at openjdk.java.net
>> Subject: [9] RFR (S) 6191224: (reflect) Misleading detail string in
>> IllegalArgumentException thrown by Array.get<Type>
>>
>> Hi,
>>
>> Please review this cleanup of a misleading exception message.
>>
>> Summary: The test case shows that an exception is thrown with the
>> message
>> "Argument is not an array", when in fact the argument is an array, but a
>> primitive type array is actually what was expected. Fixed by
>> differentiating
>> between failing because an array was expected and failing because a
>> primitive type array was expected.
>>
>> Webrev: http://cr.openjdk.java.net/~cjplummer/6191224/webrev.00/
>> Bug: https://bugs.openjdk.java.net/browse/JDK-6191224
>>
>> Tested with:
>> jprt "-testset hotspot"
>> JTReg with hotspot tests and some jdk tests
>> JCK vm, lang, api
>> vm.quick.testlist
>> runthese
>>
>> Output for the regression test when passing is:
>>
>> 2147483647
>> Test #1 PASSES
>> java.lang.IllegalArgumentException: Argument is not a primitive type
>> array
>> Test #2 PASSES
>> java.lang.IllegalArgumentException: Argument is not an array Test #3
>> PASSES
>>
>> And when it fails:
>>
>> 2147483647
>> Test #1 PASSES
>> java.lang.IllegalArgumentException: Argument is not an array Test #2
>> FAILS -
>> incorrect message
>>
>> thanks,
>>
>> Chris
>>
>>
More information about the hotspot-runtime-dev
mailing list