File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/TestPlanGui.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/XPathAssertionGui.java | |||
Method name: void modifyTestElement(TestElement)
|
Method name: void modifyTestElement(TestElement)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | super.configureTestElement(plan);↵ | 1 | super.configureTestElement(el);↵ | |
2 | if (plan instanceof TestPlan) {↵ | 2 | if (el instanceof ↵ | |
3 | TestPlan tp = (TestPlan) plan;↵ | |||
4 | tp.setFunctionalMode(functionalMode.isSelected());↵ | |||
5 | tp.setSerialized(serializedMode.isSelected());↵ | |||
6 | tp.setUserDefinedVariables((Arguments) argsPanel.createTestElement());↵ | |||
7 | tp.setTestPlanClasspathArray(browseJar.getFiles()↵ | 3 | XPathAssertion) {↵ | |
4 | XPathAssertion assertion = (XPathAssertion) el;↵ | |||
5 | assertion.setNegated(xpath.isNegated());↵ | |||
6 | assertion.setXPathString(xpath.getXPath());↵ | |||
8 | );↵ | 7 | xml.modifyTestElement(assertion);↵ | |
9 | } | 8 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 31 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 2.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | super.configureTestElement(plan); |
| 1 | super.configureTestElement(el); | |||||||||||||||||||||||||||||
2 | if (plan instanceof TestPlan) |
| 2 | if (el instanceof XPathAssertion) | |||||||||||||||||||||||||||||
3 | TestPlan tp = (TestPlan)plan; |
| 3 | XPathAssertion assertion = (XPathAssertion)el; | |||||||||||||||||||||||||||||
4 | tp.setFunctionalMode(functionalMode.isSelected()); |
| 4 | assertion.setNegated(xpath.isNegated()); | |||||||||||||||||||||||||||||
| 5 | assertion.setXPathString(xpath.getXPath()); | |||||||||||||||||||||||||||||||
5 | tp.setSerialized(serializedMode.isSelected()); | | |||||||||||||||||||||||||||||||
| 6 | xml.modifyTestElement(assertion); | |||||||||||||||||||||||||||||||
6 | tp.setUserDefinedVariables((Arguments)argsPanel.createTestElement()); | | |||||||||||||||||||||||||||||||
7 | tp.setTestPlanClasspathArray(browseJar.getFiles()); | |
Row | Violation |
---|---|
1 | Expression tp.setFunctionalMode(functionalMode.isSelected()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression assertion.setNegated(xpath.isNegated()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression tp.setFunctionalMode(functionalMode.isSelected()) is a void method call, and thus it cannot be parameterized |
4 | Expression assertion.setNegated(xpath.isNegated()) is a void method call, and thus it cannot be parameterized |
5 | Clone fragment #1 returns variable tp with type org.apache.jmeter.testelement.TestPlan , while Clone fragment #2 returns variable assertion with type org.apache.jmeter.assertions.XPathAssertion |