This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-scxml.git

commit 2ee7be458e8728d9a3dba98b1948171fefaea308
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Dec 10 11:09:42 2023 -0500

    Use constant instead of magic string
---
 .../java/org/apache/commons/scxml2/env/javascript/JSEvaluator.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/scxml2/env/javascript/JSEvaluator.java 
b/src/main/java/org/apache/commons/scxml2/env/javascript/JSEvaluator.java
index 6cc982bf..073fceb1 100644
--- a/src/main/java/org/apache/commons/scxml2/env/javascript/JSEvaluator.java
+++ b/src/main/java/org/apache/commons/scxml2/env/javascript/JSEvaluator.java
@@ -19,6 +19,7 @@ package org.apache.commons.scxml2.env.javascript;
 
 import java.io.IOException;
 import java.io.UncheckedIOException;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import javax.script.Bindings;
@@ -263,9 +264,8 @@ public class JSEvaluator extends AbstractBaseEvaluator {
             engine = new ScriptEngineManager().getEngineByName("JavaScript");
             if (initGlobalsScript == null) {
                 try {
-                    initGlobalsScript = 
IOUtils.toString(JSEvaluator.class.getResourceAsStream("init_global.js"), 
"UTF-8");
-                }
-                catch (final IOException ioe) {
+                    initGlobalsScript = 
IOUtils.toString(JSEvaluator.class.getResourceAsStream("init_global.js"), 
StandardCharsets.UTF_8);
+                } catch (final IOException ioe) {
                     throw new UncheckedIOException("Failed to load 
init_global.js from classpath", ioe);
                 }
             }

Reply via email to