checked exceptions

22 views
Skip to first unread message

Jay Han

unread,
Oct 16, 2014, 11:17:52 AM10/16/14
to yeti...@googlegroups.com
I know Yeti does not have them.

Suppose there is a Java library and you need to override/implement a constructor/method that throws a checked exception. And this constructor/method is called back from the library that expects the exactly matching signature. This seems impossible to do (judging from the current tutorial) without resorting to something outside of the language (say reflection and/or bytecode manipulation)?

Madis

unread,
Oct 17, 2014, 8:07:07 AM10/17/14
to yeti...@googlegroups.com
Normal Java doesn't expect exactly matching signature. It expects that you
don't throw anything else than was originally declared. It is perfectly ok
to NOT throw anything at all, which is what Yeti declares for all methods
it generates. Since JVM is inherently unchecked (Java checked exceptions
are checked at compile time only), it's ok at runtime.

So essentially Yeti is lying to Java compiler, which breaks the safety of
Java checked exceptions, but it shouldn't make integrating Java and Yeti
code harder.
Reply all
Reply to author
Forward
0 new messages