Iterator iter = testListeners.getSearchResults().iterator(); while (iter.hasNext()) { TestListener tl = (TestListener) iter.next(); if (tl instanceof TestBean) { TestBeanHelper.prepare((TestElement) tl); } if (host == null) { tl.testStarted(); } else { tl.testStarted(host); } }
Iterator iter = testListeners.getSearchResults().iterator(); while (iter.hasNext()) { TestListener tl = (TestListener) iter.next(); if (tl instanceof TestBean) { TestBeanHelper.prepare((TestElement) tl); } if (host == null) { tl.testEnded(); } else { tl.testEnded(host); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/engine/StandardJMeterEngine.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/engine/StandardJMeterEngine.java
Method name: void notifyTestListenersOfStart() Method name: void notifyTestListenersOfEnd()
Number of AST nodes: 8 Number of AST nodes: 8
1
Iterator iter = testListeners.getSearchResults().iterator();
1
Iterator iter = testListeners.getSearchResults().iterator();
2
		while (iter.hasNext()) {
2
		while (iter.hasNext()) {
3
			TestListener tl = (TestListener) iter.next();
3
			TestListener tl = (TestListener) iter.next();
4
			if (tl instanceof TestBean) {
4
			if (tl instanceof TestBean) {
5
			    TestBeanHelper.prepare((TestElement) tl);
5
			    TestBeanHelper.prepare((TestElement) tl);
6
			}
6
			}
7
			if (host == null) {
7
			if (host == null) {
8
				tl.testStarted();
8
				tl.testEnded();
9
			} else {
9
			} else {
10
				tl.testStarted(host);
10
				tl.testEnded(host);
11
			}
11
			}
12
		}
12
		}
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.3
Clones locationClones are declared in the same class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8877.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Iterator iter = testListeners.getSearchResults().iterator();
    2
    Iterator iter = testListeners.getSearchResults().iterator();
    2
    while (iter.hasNext())
    3
    while (iter.hasNext())
    3
    TestListener tl = (TestListener)iter.next();
    4
    TestListener tl = (TestListener)iter.next();
    4
    if (tl instanceof TestBean)
    5
    if (tl instanceof TestBean)
    5
    TestBeanHelper.prepare((TestElement)tl);
    6
    TestBeanHelper.prepare((TestElement)tl);
    6
    if (host == null)
    7
    if (host == null)
    7
    tl.testStarted();
    7
    tl.testStarted();
    8
    tl.testEnded();
    Differences
    Expression1Expression2Difference
    testStartedtestEndedMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression tl.testStarted() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tl.testEnded() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tl.testStarted() is a void method call, and thus it cannot be parameterized
    Expression tl.testEnded() is a void method call, and thus it cannot be parameterized
    8
    tl.testEnded();
    else
    else
    8
    tl.testStarted(host);
    8
    tl.testStarted(host);
    9
    tl.testEnded(host);
    Differences
    Expression1Expression2Difference
    testStartedtestEndedMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression tl.testStarted(host) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tl.testEnded(host) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tl.testStarted(host) is a void method call, and thus it cannot be parameterized
    Expression tl.testEnded(host) is a void method call, and thus it cannot be parameterized
    9
    tl.testEnded(host);
    Precondition Violations (8)
    Row Violation
    1Expression tl.testStarted() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression tl.testEnded() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression tl.testStarted() is a void method call, and thus it cannot be parameterized
    4Expression tl.testEnded() is a void method call, and thus it cannot be parameterized
    5Expression tl.testStarted(host) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression tl.testEnded(host) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression tl.testStarted(host) is a void method call, and thus it cannot be parameterized
    8Expression tl.testEnded(host) is a void method call, and thus it cannot be parameterized