if (myClass.isInstance(args)) { if (ascending) { elements.addFirst(args); } else { elements.add(args); } }
if (myClass.isInstance(element)) { if (ascending) { elements.addFirst(element); } else { elements.add(element); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/ProxyControl.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
Method name: Collection findApplicableElements(JMeterTreeNode, Class, boolean) Method name: Collection findApplicableElements(JMeterTreeNode, Class, boolean)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (myClass.isInstance(args)) {
1
if (myClass.isInstance(element)) {
2
							if (ascending) {
2
					if (ascending) {
3
								elements.addFirst(args);
3
						elements.addFirst(element);
4
							} else {
4
					} else {
5
								elements.add(args);
5
						elements.add(element);
6
							}
6
					}
7
						}
7
				}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    26
    if (myClass.isInstance(args))
    26
    if (myClass.isInstance(args))
    8
    if (myClass.isInstance(element))
    Differences
    Expression1Expression2Difference
    argselementVARIABLE_NAME_MISMATCH
    org.apache.jmeter.config.Argumentsorg.apache.jmeter.testelement.TestElementVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.config.Arguments of variable args does not match with type org.apache.jmeter.testelement.TestElement of variable element
    • Make classes org.apache.jmeter.config.Arguments and org.apache.jmeter.testelement.TestElement extend a common superclass
    8
    if (myClass.isInstance(element))
    27
    if (ascending)
    9
    if (ascending)
    28
    elements.addFirst(args);
    28
    elements.addFirst(args);
    10
    elements.addFirst(element);
    Differences
    Expression1Expression2Difference
    argselementVARIABLE_NAME_MISMATCH
    org.apache.jmeter.config.Argumentsorg.apache.jmeter.testelement.TestElementVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.config.Arguments of variable args does not match with type org.apache.jmeter.testelement.TestElement of variable element
    • Make classes org.apache.jmeter.config.Arguments and org.apache.jmeter.testelement.TestElement extend a common superclass
    10
    elements.addFirst(element);
    else
    else
    29
    elements.add(args);
    29
    elements.add(args);
    11
    elements.add(element);
    Differences
    Expression1Expression2Difference
    argselementVARIABLE_NAME_MISMATCH
    org.apache.jmeter.config.Argumentsorg.apache.jmeter.testelement.TestElementVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.config.Arguments of variable args does not match with type org.apache.jmeter.testelement.TestElement of variable element
    • Make classes org.apache.jmeter.config.Arguments and org.apache.jmeter.testelement.TestElement extend a common superclass
    11
    elements.add(element);
    Precondition Violations (3)
    Row Violation
    1Type org.apache.jmeter.config.Arguments of variable args does not match with type org.apache.jmeter.testelement.TestElement of variable element
    2Type org.apache.jmeter.config.Arguments of variable args does not match with type org.apache.jmeter.testelement.TestElement of variable element
    3Type org.apache.jmeter.config.Arguments of variable args does not match with type org.apache.jmeter.testelement.TestElement of variable element