try { if (sampleStore.size() != 0) { listener.processBatch(sampleStore); sampleStore.clear(); } listener.testEnded(host); } catch (RemoteException err) { log.error("testEnded(host)", err); }
try { if (sampleStore.size() != 0) { sendBatch(); } listener.testEnded(); } catch (RemoteException err) { log.warn("testEnded()", err); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/samplers/BatchSampleSender.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/samplers/StatisticalSampleSender.java
Method name: void testEnded(String) Method name: void testEnded()
Number of AST nodes: 5 Number of AST nodes: 4
1
try {
1
try {
2
			if (sampleStore.size() != 0) {
2
			if (sampleStore.size() != 0) {
3
				listener.processBatch(sampleStore);
3
				
4
				sampleStore.clear();
4
sendBatch();
5
			}
5
			}
6
			listener.testEnded(host);
6
			listener.testEnded();
7
		} catch (RemoteException err) {
7
		} catch (RemoteException err) {
8
			log.error("testEnded(host)", err);
8
			log.warn("testEnded()", err);
9
		}
9
		}
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 in different classes
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)10780.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    1
    try
    Differences
    Expression1Expression2Difference
    errorwarnMETHOD_INVOCATION_NAME_MISMATCH
    "testEnded(host)""testEnded()"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression log.error("testEnded(host)",err) is a void method call, and thus it cannot be parameterized
    Expression log.warn("testEnded()",err) is a void method call, and thus it cannot be parameterized
    1
    try
    2
    if (sampleStore.size() != 0)
    2
    if (sampleStore.size() != 0)
    3
    listener.processBatch(sampleStore);
    3
    listener.processBatch(sampleStore);
    Preondition Violations
    Unmatched statement listener.processBatch(sampleStore); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement listener.processBatch(sampleStore); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                
    4
    sampleStore.clear();
    4
    sampleStore.clear();
    3
    sendBatch();
    Differences
    Expression1Expression2Difference
    clearsendBatchMETHOD_INVOCATION_NAME_MISMATCH
    sampleStoreMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression sampleStore.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sendBatch() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method sendBatch
    Expression sampleStore.clear() is a void method call, and thus it cannot be parameterized
    Expression sendBatch() is a void method call, and thus it cannot be parameterized
    Expression sampleStore.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sendBatch() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method sendBatch
    Expression sampleStore.clear() is a void method call, and thus it cannot be parameterized
    Expression sendBatch() is a void method call, and thus it cannot be parameterized
    3
    sendBatch();
    5
    listener.testEnded(host);
    5
    listener.testEnded(host);
    4
    listener.testEnded();
    Differences
    Expression1Expression2Difference
    listener.testEnded(host)listener.testEnded()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression listener.testEnded(host) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression listener.testEnded() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression listener.testEnded(host) is a void method call, and thus it cannot be parameterized
    Expression listener.testEnded() is a void method call, and thus it cannot be parameterized
    4
    listener.testEnded();
    Precondition Violations (16)
    Row Violation
    1Expression log.error("testEnded(host)",err) is a void method call, and thus it cannot be parameterized
    2Expression log.warn("testEnded()",err) is a void method call, and thus it cannot be parameterized
    3Unmatched statement listener.processBatch(sampleStore); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement listener.processBatch(sampleStore); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5Expression sampleStore.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression sendBatch() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression sampleStore.clear() is a void method call, and thus it cannot be parameterized
    8Expression sendBatch() is a void method call, and thus it cannot be parameterized
    9Expression sampleStore.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression sendBatch() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression sampleStore.clear() is a void method call, and thus it cannot be parameterized
    12Expression sendBatch() is a void method call, and thus it cannot be parameterized
    13Expression listener.testEnded(host) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    14Expression listener.testEnded() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    15Expression listener.testEnded(host) is a void method call, and thus it cannot be parameterized
    16Expression listener.testEnded() is a void method call, and thus it cannot be parameterized