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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

import javax.swing.JPopupMenu;

import org.apache.commons.collections4.map.LRUMap;
import org.apache.jmeter.assertions.Assertion;
import org.apache.jmeter.assertions.gui.AbstractAssertionGui;
import org.apache.jmeter.config.ConfigElement;
Expand Down Expand Up @@ -69,6 +68,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;

/**
* JMeter GUI element editing for TestBean elements.
* <p>
Expand Down Expand Up @@ -109,7 +111,10 @@ public class TestBeanGUI extends AbstractJMeterGuiComponent implements JMeterGUI
* needs to be limited, though, to avoid memory issues when editing very
* large test plans.
*/
private final Map<TestElement, Customizer> customizers = new LRUMap<>(20);
private final Cache<TestElement, Customizer> customizers =
Caffeine.newBuilder() // TOOD: should this be made static?
.maximumSize(20)
.build();

/** Index of the customizer in the JPanel's child component list: */
private int customizerIndexInPanel;
Expand Down Expand Up @@ -325,7 +330,7 @@ private void setValues(TestElement element) {
if (initialized){
remove(customizerIndexInPanel);
}
Customizer c = customizers.computeIfAbsent(element, e -> {
Customizer c = customizers.get(element, e -> {
Customizer result = createCustomizer();
result.setObject(propertyMap);
return result;
Expand Down
1 change: 1 addition & 0 deletions xdocs/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Summary
<ul>
<li><pr>725</pr>Add Chinese Simplified Translation for Open Model Thread Group</li>
<li><pr>5710</pr>Add GitHub Issue templates</li>
<li><pr>5910</pr>Use Caffeine for caching customizers in TestBeanGUI instead of commons-collections4 LRUMap</li>
<li><pr>5713</pr>Update Spock to 2.2-groovy-3.0 (from 2.1-groovy-3.0)</li>
<li><issue>5718</issue>Update Apache commons-text to 1.10.0 (from 1.9)</li>
<li><pr>5731</pr>Update docs for <code>changeCase</code> function. <code>UPPER</code> is the default.
Expand Down