8068978: All versions of javax.script.ScriptEngine.eval(...) method may clarify ScriptException throwing
Reviewed-by: attila, jlaskey
--- a/jdk/src/java.scripting/share/classes/javax/script/ScriptEngine.java Mon May 25 14:08:21 2015 +0200
+++ b/jdk/src/java.scripting/share/classes/javax/script/ScriptEngine.java Mon May 25 19:09:44 2015 +0530
@@ -132,7 +132,9 @@
*
* @return The value returned from the execution of the script.
*
- * @throws ScriptException if an error occurs in script.
+ * @throws ScriptException if an error occurs in script. ScriptEngines should create and throw
+ * <code>ScriptException</code> wrappers for checked Exceptions thrown by underlying scripting
+ * implementations.
* @throws NullPointerException if either argument is null.
*/
public Object eval(Reader reader , ScriptContext context) throws ScriptException;
@@ -145,7 +147,9 @@
*
* @return The value returned from the execution of the script.
*
- * @throws ScriptException if error occurs in script.
+ * @throws ScriptException if an error occurs in script. ScriptEngines should create and throw
+ * <code>ScriptException</code> wrappers for checked Exceptions thrown by underlying scripting
+ * implementations.
* @throws NullPointerException if the argument is null.
*/
public Object eval(String script) throws ScriptException;
@@ -158,7 +162,9 @@
*
* @return The value returned by the script.
*
- * @throws ScriptException if an error occurs in script.
+ * @throws ScriptException if an error occurs in script. ScriptEngines should create and throw
+ * <code>ScriptException</code> wrappers for checked Exceptions thrown by underlying scripting
+ * implementations.
* @throws NullPointerException if the argument is null.
*/
public Object eval(Reader reader) throws ScriptException;
@@ -177,7 +183,9 @@
*
* @return The value returned by the script.
*
- * @throws ScriptException if an error occurs in script.
+ * @throws ScriptException if an error occurs in script. ScriptEngines should create and throw
+ * <code>ScriptException</code> wrappers for checked Exceptions thrown by underlying scripting
+ * implementations.
* @throws NullPointerException if either argument is null.
*/
public Object eval(String script, Bindings n) throws ScriptException;
@@ -191,7 +199,9 @@
*
* @return The value returned by the script.
*
- * @throws ScriptException if an error occurs.
+ * @throws ScriptException if an error occurs in script. ScriptEngines should create and throw
+ * <code>ScriptException</code> wrappers for checked Exceptions thrown by underlying scripting
+ * implementations.
* @throws NullPointerException if either argument is null.
*/
public Object eval(Reader reader , Bindings n) throws ScriptException;