Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions LEGALNOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ and subject to their respective licenses.
| jfreechart-1.5.6.jar | LGPL |
| jgrapht-core-0.9.2.jar | LGPL 2.1 |
| json-lib-2.4-jdk15.jar | MIT + "Good, Not Evil" |
| log4j-1.2-api-2.26.0.jar | Apache 2.0 |
| log4j-api-2.26.0.jar | Apache 2.0 |
| log4j-core-2.26.0.jar | Apache 2.0 |
| log4j-jul-2.26.0.jar | Apache 2.0 |
| log4j-1.2-api-2.26.1.jar | Apache 2.0 |
| log4j-api-2.26.1.jar | Apache 2.0 |
| log4j-core-2.26.1.jar | Apache 2.0 |
| log4j-jul-2.26.1.jar | Apache 2.0 |
| rsyntaxtextarea-3.6.3.jar | BSD-3 clause |
| swingx-all-1.6.5-1.jar | LGPL 2.1 |
| xom-1.4.6.jar | LGPL |
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[versions]
errorprone = "2.42.0"
flatlaf = "3.7.1"
log4j = "2.26.0"
log4j = "2.26.1"

[libraries]
bndAnnotation = "biz.aQute.bnd:biz.aQute.bnd.annotation:7.3.0"
bytebuddy = "net.bytebuddy:byte-buddy:1.18.10"
bytebuddy = "net.bytebuddy:byte-buddy:1.18.11"
commons-beanutils = "commons-beanutils:commons-beanutils:1.11.0"
commons-codec = "commons-codec:commons-codec:1.22.0"
commons-collections = "commons-collections:commons-collections:3.2.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.script.Invocable;
import javax.script.ScriptContext;
Expand Down Expand Up @@ -126,7 +126,7 @@ public class ExtensionScript extends ExtensionAdaptor implements CommandLineList

private ScriptTreeModel treeModel = null;
private List<ScriptEngineWrapper> engineWrappers = new ArrayList<>();
private Map<String, ScriptType> typeMap = new HashMap<>();
private Map<String, ScriptType> typeMap = new ConcurrentHashMap<>();
private ProxyListenerScript proxyListener = null;
private HttpSenderScriptListener httpSenderScriptListener;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.security.InvalidParameterException;
import java.util.Iterator;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -50,6 +52,18 @@ void cleanUp() {
Constant.messages = null;
}

@Test
void shouldReturnThreadSafeScriptTypesCollection() {
// Given
ExtensionScript extensionScript = new ExtensionScript();
extensionScript.hook(mock());
Iterator<ScriptType> it = extensionScript.getScriptTypes().iterator();
extensionScript.registerScriptType(new ScriptType("type", "i18n.type", null, true));

// When / Then
assertDoesNotThrow(it::next);
}

@Test
void shouldCreateScriptsCache() {
// Given
Expand Down
Loading