diff --git a/src/main/java/org/apache/maven/shared/scriptinterpreter/BeanShellScriptInterpreter.java b/src/main/java/org/apache/maven/shared/scriptinterpreter/BeanShellScriptInterpreter.java index 703478e..0fa8de5 100644 --- a/src/main/java/org/apache/maven/shared/scriptinterpreter/BeanShellScriptInterpreter.java +++ b/src/main/java/org/apache/maven/shared/scriptinterpreter/BeanShellScriptInterpreter.java @@ -94,12 +94,11 @@ public Object evaluateScript( String script, List classPath, Map entry : globalVariables.entrySet() ) { - Object value = globalVariables.get( variable ); try { - engine.set( variable, value ); + engine.set( entry.getKey(), entry.getValue() ); } catch ( EvalError e ) { diff --git a/src/main/java/org/apache/maven/shared/scriptinterpreter/ExecutionLogger.java b/src/main/java/org/apache/maven/shared/scriptinterpreter/ExecutionLogger.java index efa06b6..611ef91 100644 --- a/src/main/java/org/apache/maven/shared/scriptinterpreter/ExecutionLogger.java +++ b/src/main/java/org/apache/maven/shared/scriptinterpreter/ExecutionLogger.java @@ -22,20 +22,22 @@ import java.io.PrintStream; /** + *

ExecutionLogger interface.

+ * * @author Olivier Lamy */ public interface ExecutionLogger { /** - * The stream which will catch the output of the {@link ScriptRunner}. - * + * The stream which will catch the output of the {@link org.apache.maven.shared.scriptinterpreter.ScriptRunner}. + * * @return the output stream */ PrintStream getPrintStream(); /** * Consume logging from this component. - * + * * @param line the line to consume */ void consumeLine( String line ); diff --git a/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptEvaluationException.java b/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptEvaluationException.java index 382aa61..3e878e8 100644 --- a/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptEvaluationException.java +++ b/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptEvaluationException.java @@ -44,6 +44,12 @@ public class ScriptEvaluationException super( cause ); } + /** + * Creates a new exception with the specified message and cause. + * + * @param message The message, may be null. + * @param cause The cause, may be null. + */ public ScriptEvaluationException( String message, Throwable cause ) { super( message, cause ); diff --git a/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptException.java b/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptException.java index f6062ef..11404c6 100644 --- a/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptException.java +++ b/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptException.java @@ -29,6 +29,12 @@ public class ScriptException { private static final long serialVersionUID = 4553276474852776472L; + /** + * Creates a new exception with the specified message and cause. + * + * @param message The message, may be null. + * @param cause The cause, may be null. + */ public ScriptException( String message, Throwable cause ) { super( message, cause ); diff --git a/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptReturnException.java b/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptReturnException.java index 3958197..046c56b 100644 --- a/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptReturnException.java +++ b/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptReturnException.java @@ -31,6 +31,12 @@ public class ScriptReturnException extends ScriptException private final Object result; + /** + * Creates a new exception with the specified message and result. + * + * @param message The message, may be null. + * @param result The cause, may be null. + */ ScriptReturnException( String message, Object result ) { super( message ); diff --git a/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptRunner.java b/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptRunner.java index 7cd4a7f..c282a04 100644 --- a/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptRunner.java +++ b/src/main/java/org/apache/maven/shared/scriptinterpreter/ScriptRunner.java @@ -67,7 +67,7 @@ public class ScriptRunner private String encoding; /** - * Creates a new script runner. + * Creates a new script runner with BSH and Groovy interpreters. */ public ScriptRunner() { @@ -78,6 +78,12 @@ public ScriptRunner() classPath = new ArrayList<>(); } + /** + * Add new script Interpreter + * + * @param id The Id of interpreter + * @param scriptInterpreter the Script Interpreter implementation + */ public void addScriptInterpreter( String id, ScriptInterpreter scriptInterpreter ) { scriptInterpreters.put( id, scriptInterpreter );