Skip to content

Commit

Permalink
Fix SONAR warnings
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1843120 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
pmouawad committed Oct 8, 2018
1 parent 86d466b commit fe3c216
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/core/org/apache/jmeter/engine/TreeCloner.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public TreeCloner(boolean honourNoThreadClone) {
*/
@Override
public final void addNode(Object node, HashTree subTree) {
node = addNodeToTree(node);
addLast(node);
Object newNode = addNodeToTree(node);
addLast(newNode);
}

/**
Expand All @@ -71,10 +71,10 @@ public final void addNode(Object node, HashTree subTree) {
protected Object addNodeToTree(Object node) {
if ( (node instanceof TestElement) // Check can cast for clone
// Don't clone NoThreadClone unless honourNoThreadClone == false
&& (!honourNoThreadClone || !(node instanceof NoThreadClone))
&& (!(honourNoThreadClone && (node instanceof NoThreadClone)))
) {
node = ((TestElement) node).clone();
newTree.add(objects, node);
Object clonedNode = ((TestElement) node).clone();
newTree.add(objects, clonedNode);
} else {
newTree.add(objects, node);
}
Expand All @@ -100,6 +100,7 @@ public ListedHashTree getClonedTree() {

@Override
public void processPath() {
// NOOP
}

}

0 comments on commit fe3c216

Please sign in to comment.