By accident I forget to a the extra parameters to the invoke method and got an IllegalArgumentException. This generally indicates the wrong type of arguments rather than the wrong amount of parameters. It would be useful to check that Java strategies actually implement the specified amount of parameters in the invoke message (upon class loading) or through a more specific message (at some point I got an error saying the the strategy expected N parameters and that I only provided M).

Submitted by Sven Stork on 14 December 2012 at 22:10

On 15 December 2012 at 02:49 Vlad Vergu commented:

Analysis in Stratego is expected to cover this at the use-site of the strategy, and probably does. There is indeed no static check for the consistency between the Java-side and the Stratego declaration-site of an external strategy. I suspect a reflective check at load-time would be ineffective because the method with the correct arity is already implemented and non-abstract in the Strategy class. At the same time a reflective check for the existence of an overriding method may be quite expensive. Perhaps we should provide a better error message, at invocation?



On 8 January 2013 at 13:06 Eelco Visser closed this issue.

On 8 January 2013 at 13:08 Eelco Visser reopened this issue.

On 8 January 2013 at 13:08 Eelco Visser tagged stratego

On 10 March 2013 at 12:10 Guido Wachsmuth commented:

When the interpreter calls the Java method, can it catch the exception and throw a different, more specific exception?

Log in to post comments