RFR 8238175: CTW: Class.getDeclaredMethods fails with assert(k->is_subclass_of(SystemDictionary::Throwable_klass())) failed: invalid exception class

David Holmes david.holmes at oracle.com
Thu Feb 13 03:11:26 UTC 2020


Hi Harold,

On 13/02/2020 7:17 am, Harold Seigel wrote:
> Hi,
> 
> Please review this change to fix bug 8238175.  The fix removes the 
> assert that ensures, in resolved_checked_excpetions_impl(), that checked 
> exceptions are subtypes of java.lang.Throwable.  It removes the assert 
> because the JVM Spec says in section 4.7.5 
> <https://docs.oracle.com/javase/specs/jvms/se13/html/jvms-4.html#jvms-4.7.5> 
> that such checks should only be done at compile time.
> 
> The fix replaces the assert with logging to provide a mechanism for 
> users to detect, in resolved_checked_exceptions_impl(), when checked 
> exceptions are not subtypes of java.lang.Throwable.

Looks good.

Arguably java.lang.reflect.Method::getGenericExceptionTypes should says 
something about this case but ...

Thanks,
David

> Open Webrev: 
> http://cr.openjdk.java.net/~hseigel/bug_8238175/webrev/index.html
> 
> JBS Bug: https://bugs.openjdk.java.net/browse/JDK-8238175
> 
> The fix was regression tested by running Mach5 tiers 1 and 2 tests and 
> builds on Linux-x64, Solaris, Windows, and Mac OS X, by running Mach5 
> tiers 3-5 tests on Linux-x64, and JCK lang and VM tests on Linux-x64.
> 
> Thanks, Harold
> 


More information about the hotspot-runtime-dev mailing list