Prevent NPE in MapProperty.

Initialize the backing Map when no Map was passed into constructor.
Patch by belugabehr (dam6923 at gmail.com)

Bugzilla Id: 62281


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

Former-commit-id: 4bcb60d9f4
This commit is contained in:
Felix Schumacher 2018-06-03 13:44:15 +00:00
parent e3d08b9e89
commit a83329221d
3 changed files with 17 additions and 0 deletions

View File

@ -18,6 +18,7 @@
package org.apache.jmeter.testelement.property;
import java.util.HashMap;
import java.util.Map;
import org.apache.jmeter.testelement.TestElement;
@ -39,6 +40,7 @@ public class MapProperty extends MultiProperty {
public MapProperty() {
super();
value = new HashMap<>();
}
/** {@inheritDoc} */

View File

@ -0,0 +1,13 @@
package org.apache.jmeter.testelement.property;
import org.junit.Test;
public class MapPropertyTest {
@Test
public void testBug62281MapProperty() {
MapProperty props = new MapProperty();
props.addProperty("Foo", new BooleanProperty());
}
}

View File

@ -229,6 +229,7 @@ this behaviour, set <code>httpclient.reset_state_on_thread_group_iteration=false
<li><bug>62240</bug>If SampleMonitor implementation is a TestBean if will not be initialized correctly</li>
<li><bug>62295</bug>Correct order of elements when duplicating a selection of multiple elements.</li>
<li><bug>62397</bug>Don't break lines at commata when using JSON Path Tester</li>
<li><bug>62281</bug>Prevent NPE in MapProperty. Patch by belugabehr (dam6923 at gmail.com)</li>
</ul>
<!-- =================== Thanks =================== -->
@ -251,6 +252,7 @@ this behaviour, set <code>httpclient.reset_state_on_thread_group_iteration=false
<li>Perze Ababa (perze.ababa at gmail.com)</li>
<li>Martha Laks (laks.martha at gmail.com)</li>
<li>Logan Mauzaize (t524467 at airfrance.fr)</li>
<li>belugabehr (dam6923 at gmail.com)</li>
</ul>
<p>We also thank bug reporters who helped us improve JMeter.</p>
<p>