When you use bsh.Interpreter.getInterface(xxx), the
proxy you receive will have distinct behaviour depending
if the method that is called has a "throws" clause or not
and if the method is not implemented by the script.
Imagine that you have this interface:
public interface IBla
public void simple();
public void comlex() throws Exception();
and you create an Interpreter for an *empty* script (not
implementing any of the above methods).
If you then do:
IBla proxy = (IBla)interpreter.getInterface (IBla.class);
will throw an UndeclaredThrowableException
will throw an bsh.EvalError which is a CHECKED
Consequently, in the second case, your code is not
required *at compile time* to check for an exception
while a *checked* exception will be thrown at *runtime*.
Log in to post a comment.