Bug 59082 - remove the "TestCompiler.useStaticSet" parameter

Contributed by Benoit Wiart
#resolve #143
Bugzilla Id: 59082

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1733057 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: d0bf92cc88
This commit is contained in:
Philippe Mouawad 2016-03-01 12:35:26 +00:00
parent 551d97a413
commit 81a4ccd909
4 changed files with 10 additions and 18 deletions

View File

@ -31,7 +31,6 @@ import org.apache.jmeter.engine.event.LoopIterationListener;
import org.apache.jmeter.samplers.Sampler;
import org.apache.jmeter.testelement.AbstractTestElement;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.threads.TestCompiler;
import org.apache.jmeter.threads.TestCompilerHelper;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;
@ -57,8 +56,7 @@ public class GenericController extends AbstractTestElement implements Controller
private transient LinkedList<LoopIterationListener> iterationListeners = new LinkedList<>();
// Only create the map if it is required
private transient ConcurrentMap<TestElement, Object> children =
TestCompiler.IS_USE_STATIC_SET ? null : new ConcurrentHashMap<TestElement, Object>();
private transient ConcurrentMap<TestElement, Object> children = new ConcurrentHashMap<TestElement, Object>();
private static final Object DUMMY = new Object();
@ -422,7 +420,7 @@ public class GenericController extends AbstractTestElement implements Controller
protected Object readResolve(){
iterationListeners = new LinkedList<>();
children = TestCompiler.IS_USE_STATIC_SET ? null : new ConcurrentHashMap<TestElement, Object>();
children = new ConcurrentHashMap<TestElement, Object>();
subControllersAndSamplers = new ArrayList<>();
return this;

View File

@ -46,8 +46,7 @@ public abstract class AbstractThreadGroup extends AbstractTestElement
private static final long serialVersionUID = 240L;
// Only create the map if it is required
private transient final ConcurrentMap<TestElement, Object> children =
TestCompiler.IS_USE_STATIC_SET ? null : new ConcurrentHashMap<TestElement, Object>();
private transient final ConcurrentMap<TestElement, Object> children = new ConcurrentHashMap<TestElement, Object>();
private static final Object DUMMY = new Object();

View File

@ -41,7 +41,6 @@ import org.apache.jmeter.samplers.Sampler;
import org.apache.jmeter.testbeans.TestBeanHelper;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.timers.Timer;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.jorphan.collections.HashTree;
import org.apache.jorphan.collections.HashTreeTraverser;
import org.apache.jorphan.logging.LoggingManager;
@ -59,16 +58,11 @@ public class TestCompiler implements HashTreeTraverser {
private static final Logger LOG = LoggingManager.getLoggerForClass();
/**
* Set this property {@value} to true to revert to using a shared static set.
* @deprecated since 3.0 will be removed in the next version 3.1.
* Constant is not used since 3.0
*/
private static final String USE_STATIC_SET = "TestCompiler.useStaticSet";
/**
* The default value - {@value} - assumed for {@link #USE_STATIC_SET}.
*/
private static final boolean USE_STATIC_SET_DEFAULT = false;
public static final boolean IS_USE_STATIC_SET = JMeterUtils.getPropDefault(USE_STATIC_SET, USE_STATIC_SET_DEFAULT);
@Deprecated
public static final boolean IS_USE_STATIC_SET = false;
/**
* This set keeps track of which ObjectPairs have been seen.
@ -158,7 +152,7 @@ public class TestCompiler implements HashTreeTraverser {
boolean duplicate = false;
// Bug 53750: this condition used to be in ObjectPair#addTestElements()
if (parent instanceof Controller && (child instanceof Sampler || child instanceof Controller)) {
if (!IS_USE_STATIC_SET && parent instanceof TestCompilerHelper) {
if (parent instanceof TestCompilerHelper) {
TestCompilerHelper te = (TestCompilerHelper) parent;
duplicate = !te.addTestElementOnce(child);
} else { // this is only possible for 3rd party controllers by default

View File

@ -229,6 +229,7 @@ Summary
<li><bug>59046</bug>JMeter Gui Replace controller should keep the name and the selection. Contributed by Benoit Wiart (benoit dot wiart at gmail.com)</li>
<li><bug>59038</bug>Deprecate HTTPClient 3.1 related elements</li>
<li><bug>59094</bug> - Drop support of old JMX file format</li>
<li><bug>59082</bug>Remove the "TestCompiler.useStaticSet" parameter. Contributed by Benoit Wiart (benoit dot wiart at gmail.com)</li>
</ul>
<ch_section>Non-functional changes</ch_section>
<ul>