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-jexl.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f275737 Use NIO
6f275737 is described below

commit 6f275737b30fc0914f238c4e54ed74be0cb4d54d
Author: Gary D. Gregory <[email protected]>
AuthorDate: Sat Mar 15 17:37:06 2025 -0400

    Use NIO
    
    Remove unnecessary semicolon
---
 src/main/java/org/apache/commons/jexl3/JexlEngine.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/jexl3/JexlEngine.java 
b/src/main/java/org/apache/commons/jexl3/JexlEngine.java
index bd5b767e..6c08870f 100644
--- a/src/main/java/org/apache/commons/jexl3/JexlEngine.java
+++ b/src/main/java/org/apache/commons/jexl3/JexlEngine.java
@@ -19,12 +19,12 @@ package org.apache.commons.jexl3;
 
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.math.MathContext;
 import java.net.URL;
 import java.nio.charset.Charset;
+import java.nio.file.Files;
 import java.util.Objects;
 
 import org.apache.commons.jexl3.introspection.JexlUberspect;
@@ -48,7 +48,7 @@ import org.apache.commons.jexl3.introspection.JexlUberspect;
 public abstract class JexlEngine {
 
     /** Default constructor */
-    public JexlEngine() {}; // Keep Javadoc happy
+    public JexlEngine() {} // Keep Javadoc happy
 
     /**
      * The empty context class, public for instrospection.
@@ -574,8 +574,7 @@ public abstract class JexlEngine {
      */
     protected String readSource(final File file) {
         Objects.requireNonNull(file, "file");
-        try (BufferedReader reader = new BufferedReader(new 
InputStreamReader(new FileInputStream(file),
-                getCharset()))) {
+        try (BufferedReader reader = Files.newBufferedReader(file.toPath(), 
getCharset())) {
             return toString(reader);
         } catch (final IOException xio) {
             throw new JexlException(createInfo(file.toString(), 1, 1), "could 
not read source File", xio);

Reply via email to