Removed javaengine and minor cleanup.
Author: NosBit Source: L2jUnity free release
This commit is contained in:
@@ -23,6 +23,7 @@ import java.nio.file.Paths;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
@@ -168,8 +169,8 @@ public final class ScriptEngineManager
|
||||
// throws exception if not exists or not file
|
||||
checkExistingFile("ScriptList", SCRIPT_LIST_FILE);
|
||||
|
||||
final LinkedHashMap<IExecutionContext, LinkedList<Path>> files = new LinkedHashMap<>();
|
||||
final LinkedList<String> extWithoutEngine = new LinkedList<>();
|
||||
final Map<IExecutionContext, List<Path>> files = new LinkedHashMap<>();
|
||||
final List<String> extWithoutEngine = new LinkedList<>();
|
||||
|
||||
Files.lines(SCRIPT_LIST_FILE).forEach(line ->
|
||||
{
|
||||
@@ -209,7 +210,7 @@ public final class ScriptEngineManager
|
||||
return;
|
||||
}
|
||||
|
||||
LinkedList<Path> ll = files.get(engine);
|
||||
List<Path> ll = files.get(engine);
|
||||
if (ll == null)
|
||||
{
|
||||
ll = new LinkedList<>();
|
||||
@@ -218,7 +219,7 @@ public final class ScriptEngineManager
|
||||
ll.add(sourceFile);
|
||||
});
|
||||
|
||||
for (Entry<IExecutionContext, LinkedList<Path>> entry : files.entrySet())
|
||||
for (Entry<IExecutionContext, List<Path>> entry : files.entrySet())
|
||||
{
|
||||
_currentExecutionContext = entry.getKey();
|
||||
try
|
||||
|
@@ -20,6 +20,7 @@ import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
@@ -223,13 +224,7 @@ public final class JavaExecutionContext extends AbstractExecutionContext<JavaScr
|
||||
@Override
|
||||
public Entry<Path, Throwable> executeScript(final Path sourcePath) throws Exception
|
||||
{
|
||||
@SuppressWarnings("serial")
|
||||
Map<Path, Throwable> executionFailures = executeScripts(new LinkedList<Path>()
|
||||
{
|
||||
{
|
||||
add(sourcePath);
|
||||
}
|
||||
});
|
||||
final Map<Path, Throwable> executionFailures = executeScripts(Arrays.asList(sourcePath));
|
||||
if (!executionFailures.isEmpty())
|
||||
{
|
||||
return executionFailures.entrySet().iterator().next();
|
||||
|
Reference in New Issue
Block a user