As you may know already, Mustang (Java SE 6) includes JSR-223: Scripting for the Java Platform API. There was a recent change (since Mustang build 91) in javax.script.Invocable interface. Previously, there were two invoke methods in this interface - one for calling script top-level or global functions from Java and another for calling methods on script object. These have been renamed to invokeFunction and invokeMethod respectively.
javax.script.Invocable interface used to have the following methods:
// call script global function
invoke(String name, Object...args)
// call method on a script object
invoke(Object this, String name, Object...args)
This results in a problem when invoking a function with String arguments. For example, the following call
Object ret = engine.invoke("functionName", "arg1", "arg2", "arg3");
is ambiguous. javac cannot tell which invoke overload is being called. User gets an error that looks like:
reference to invoke is ambiguous, both method invoke(java.lang.Object,
java.lang.String,java.lang.Object...) in javax.script.Invocable and method
invoke(java.lang.String,java.lang.Object...) in javax.script.Invocable match
Now, these methods have been renamed to
// call a script global function
invokeFunction(String name, Object...args)
// call a method on a script object
invokeMethod(Object this, String name, Object...args)
The JavaScript engine (co-bundled in Sun's Java SE 6 implementation) and the script engines maintained at http://scripting.dev.java.net have been fixed to track this interface change. If you are maintaining/implementing your own JSR-223 engine, please fix it for this change.
In addition to this, scripting.dev.java.net project has been updated to useIf you are using http://phobos.dev.java.net, you may want to refer to Roberto Chinnici's blog entry titled Tracking JSR-223 Changes