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.4
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)5.0
    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.TestElementSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression args cannot be unified with expression element , because common superclass type org.apache.jmeter.testelement.TestElement cannot be passed as an argument to public native boolean isInstance(java.lang.Object)
    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.TestElementSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression args cannot be unified with expression element , because common superclass type org.apache.jmeter.testelement.TestElement cannot be passed as an argument to public void addFirst(java.lang.Object)
    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.TestElementSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression args cannot be unified with expression element , because common superclass type org.apache.jmeter.testelement.TestElement cannot be passed as an argument to public boolean add(java.lang.Object)
    11
    elements.add(element);
    Precondition Violations (3)
    Row Violation
    1Expression args cannot be unified with expression element , because common superclass type org.apache.jmeter.testelement.TestElement cannot be passed as an argument to public native boolean isInstance(java.lang.Object)
    2Expression args cannot be unified with expression element , because common superclass type org.apache.jmeter.testelement.TestElement cannot be passed as an argument to public void addFirst(java.lang.Object)
    3Expression args cannot be unified with expression element , because common superclass type org.apache.jmeter.testelement.TestElement cannot be passed as an argument to public boolean add(java.lang.Object)