elharo commented on code in PR #67:
URL: 
https://github.com/apache/maven-scripting-plugin/pull/67#discussion_r2651022465


##########
src/main/java/org/apache/maven/plugins/scripting/ResourceScriptEvaluator.java:
##########
@@ -58,22 +58,27 @@ public ResourceScriptEvaluator(String engineName, String 
resourceName) {
     }
 
     /**
-     * @param engine the script engine
+     * @param engine  the script engine

Review Comment:
   remove extra space



##########
src/main/java/org/apache/maven/plugins/scripting/ResourceScriptEvaluator.java:
##########
@@ -58,22 +58,27 @@ public ResourceScriptEvaluator(String engineName, String 
resourceName) {
     }
 
     /**
-     * @param engine the script engine
+     * @param engine  the script engine
      * @param context the script context
      * @return the result of the scriptFile
      * @throws ScriptException if an error occurs in script
      * @see 
org.apache.maven.plugins.scripting.AbstractScriptEvaluator#eval(javax.script.ScriptEngine,
 javax.script.ScriptContext)
      */
     protected Object eval(ScriptEngine engine, ScriptContext context) throws 
ScriptException {
 
-        try (InputStream is = 
this.getClass().getClassLoader().getResourceAsStream(resourceName);
-                Reader reader = new InputStreamReader(is)) {
-            return engine.eval(reader, context);
+        try (InputStream is = 
this.getClass().getClassLoader().getResourceAsStream(resourceName)) {
+
+            if (is == null) throw new ScriptException("Resource not found : " 
+ resourceName);

Review Comment:
   Error:  
src/main/java/org/apache/maven/plugins/scripting/ResourceScriptEvaluator.java:[71,13]
 (blocks) NeedBraces: 'if' construct must use '{}'s.



##########
src/main/java/org/apache/maven/plugins/scripting/ResourceScriptEvaluator.java:
##########
@@ -48,7 +48,7 @@ public class ResourceScriptEvaluator extends 
AbstractScriptEvaluator {
     private final String engineName;
 
     /**
-     * @param engineName optional engine name, used to override the engine 
selection from the file extension
+     * @param engineName   optional engine name, used to override the engine 
selection from the file extension

Review Comment:
   extra space not needed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to