You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2012/05/21 03:59:57 UTC

[Bug 50898] IncludeController : NullPointerException loading script in non-GUI mode if Includers use same element name

https://issues.apache.org/bugzilla/show_bug.cgi?id=50898

--- Comment #17 from Sebb <se...@apache.org> ---
The problem is in the ListedHashTree#replace method.

This updates the order of elements using the code:

order.set(order.indexOf(currentKey), newKey);

The problem is that indexOf() uses equals() to scan the LinkedList to find the
matching Object. The current implementation of equals for TestElelemts compares
contents. So if there are two identical Include Controllers the wrong key may
be found. [This problem does not affect the tree itself, because that is a hash
tree, and test elements use the identity hashcode.]

I suspect this does not affect the GUI tests because the Test Elements will
then have additional properties which relate to the GUI.

The bug can be fixed by using Object equality for equals; unit tests all still
work apart from TestHTTPFileArgs.testRemoving() which assumes that HTTPFileArgs
are equal if they have equal contents. That could be fixed separately.

I'm not entirely sure what it means for two test elements to be truly "equal".
At present, they violate the rule that equal objects must have equal hash
codes.

However, changing the AbstractTestElement#equals() method is a very big change
and may have unexpected consequences (apart from just HTTPFileArgs).

As a workround for this bug, the IncludeController can be fixed to use Object
equals.
After further testing, the fix can hopefully be extended to all test elements.

-- 
You are receiving this mail because:
You are the assignee for the bug.