Fixed several dozen bugs as detected by FindBugs

This commit is contained in:
Obique PSWG
2015-10-10 23:36:16 -05:00
parent c89486185e
commit 5315185e7d
28 changed files with 190 additions and 70 deletions
+4 -2
View File
@@ -27,8 +27,10 @@
***********************************************************************************/
package utilities;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import javax.script.Invocable;
@@ -70,7 +72,7 @@ public class Scripts {
@SuppressWarnings("unchecked")
public static <T> T invoke(String script, String function, Object... args) {
try {
ENGINE.eval(new FileReader(SCRIPTS + script + EXTENSION));
ENGINE.eval(new InputStreamReader(new FileInputStream(SCRIPTS + script + EXTENSION), StandardCharsets.UTF_8));
return (T) INVOCABLE.invokeFunction(function, args);
} catch (FileNotFoundException e) {
// No need to print anything, this is a common error.