RFR 8251414: Add test that invokeinterface of a protected method in java.lang.Object throws NoSuchMethodError

Harold Seigel harold.seigel at oracle.com
Tue Aug 18 17:36:12 UTC 2020


Hi David,

The test was adapted from an existing test that used reflection. It 
probably doesn't need to use it.

If test file InterfaceObj.jasm is written in java, as described in the 
file's comments, then its compilation fails with the following errors:

    javac I.java InterfaceObj.java InterfaceObjectTest.java
    InterfaceObj.java:3: error: cannot find symbol
             I.finalize();
              ^
       symbol:   method finalize()
       location: interface I
    InterfaceObj.java:9: error: cannot find symbol
             I.clone();
              ^
       symbol:   method clone()
       location: interface I

Thanks, Harold


On 8/17/2020 5:53 PM, David Holmes wrote:
> Hi Harold,
>
> On 18/08/2020 12:26 am, Harold Seigel wrote:
>> Hi David,
>>
>> This change got pushed before I saw your comments.  Let me know if I 
>> should enter a new RFE to add the comments that you request below.
>
> No that's okay. But can you tell me why it needed to use jasm and 
> reflection? :)
>
> Thanks,
> David
>
>> Thanks, Harold
>>
>> On 8/16/2020 10:06 PM, David Holmes wrote:
>>> Hi Harold,
>>>
>>> On 13/08/2020 4:14 am, Harold Seigel wrote:
>>>> Hi,
>>>>
>>>> Please review this change to add test cases to test 
>>>> hotspot/jtreg/runtime/8026394/InterfaceObjectTest.java to check for 
>>>> NoSuchMethodError exceptions when calling Object protected methods 
>>>> clone() and finalize() using invokeinterface.
>>>>
>>>> Open Webrev: 
>>>> http://cr.openjdk.java.net/~hseigel/bug_8251414/webrev/index.html
>>>
>>> Can you add a comment explaining why we need to use jasm and 
>>> reflection in this new case.
>>>
>>> Thanks,
>>> David
>>>
>>>> JBS Bug: https://bugs.openjdk.java.net/browse/JDK-8251414
>>>>
>>>> The fix was tested by running the modified test on multiple 
>>>> platforms, including Mac OS, Windows, and Linux.
>>>>
>>>> Thanks, Harold


More information about the hotspot-runtime-dev mailing list