if (attr.equals(Constants.MEMORY_TOTAL)) { memory.setTotal(parseLong(attributes.getValue(idx))); } else if (attr.equals(Constants.MEMORY_MAX)) { memory.setMax(parseLong(attributes.getValue(idx))); }
if (attr.equals(Constants.CURRENTTHREADCOUNT)) { threadinfo.setCurrentThreadCount(parseInt(attributes.getValue(idx))); } else if (attr.equals(Constants.CURRENTBUSYTHREADS)) { threadinfo.setCurrentThreadsBusy(parseInt(attributes.getValue(idx))); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/monitor/parser/MonitorHandler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/monitor/parser/MonitorHandler.java
Method name: void startElement(String, String, String, Attributes) Method name: void startElement(String, String, String, Attributes)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (attr.equals(Constants.MEMORY_TOTAL)) {
1
if (attr.equals(Constants.
2
							memory.setTotal
2
CURRENTTHREADCOUNT)) {
3
(parseLong(attributes.getValue(idx)));
3
							threadinfo.setCurrentThreadCount(parseInt(attributes.getValue(idx)));
4
						} else if (attr.equals(Constants.MEMORY_MAX)) {
4
						} else if (attr.equals(Constants.
5
							memory.setMax
5
CURRENTBUSYTHREADS)) {
6
(parseLong(attributes.getValue(idx)));
6
							threadinfo.setCurrentThreadsBusy(parseInt(attributes.getValue(idx)));
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.6
Clones locationClones are in the same method
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)2.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    18
    else if (attr.equals(Constants.MEMORY_TOTAL))
    18
    else if (attr.equals(Constants.MEMORY_TOTAL))
    47
    else if (attr.equals(Constants.CURRENTTHREADCOUNT))
    Differences
    Expression1Expression2Difference
    MEMORY_TOTALCURRENTTHREADCOUNTVARIABLE_NAME_MISMATCH
    47
    else if (attr.equals(Constants.CURRENTTHREADCOUNT))
    19
    memory.setTotal(parseLong(attributes.getValue(idx)));
    19
    memory.setTotal(parseLong(attributes.getValue(idx)));
    Preondition Violations
    Unmatched statement memory.setTotal(parseLong(attributes.getValue(idx))); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                      
                                                                                                                                                      
    48
    threadinfo.setCurrentThreadCount(parseInt(attributes.getValue(idx)));
    Preondition Violations
    Unmatched statement threadinfo.setCurrentThreadCount(parseInt(attributes.getValue(idx))); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    48
    threadinfo.setCurrentThreadCount(parseInt(attributes.getValue(idx)));
    20
    else if (attr.equals(Constants.MEMORY_MAX))
    20
    else if (attr.equals(Constants.MEMORY_MAX))
    49
    else if (attr.equals(Constants.CURRENTBUSYTHREADS))
    Differences
    Expression1Expression2Difference
    MEMORY_MAXCURRENTBUSYTHREADSVARIABLE_NAME_MISMATCH
    49
    else if (attr.equals(Constants.CURRENTBUSYTHREADS))
    21
    memory.setMax(parseLong(attributes.getValue(idx)));
    21
    memory.setMax(parseLong(attributes.getValue(idx)));
    Preondition Violations
    Unmatched statement memory.setMax(parseLong(attributes.getValue(idx))); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                  
                                                                                                                                                      
    50
    threadinfo.setCurrentThreadsBusy(parseInt(attributes.getValue(idx)));
    Preondition Violations
    Unmatched statement threadinfo.setCurrentThreadsBusy(parseInt(attributes.getValue(idx))); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    50
    threadinfo.setCurrentThreadsBusy(parseInt(attributes.getValue(idx)));
    Precondition Violations (4)
    Row Violation
    1Unmatched statement memory.setTotal(parseLong(attributes.getValue(idx))); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement threadinfo.setCurrentThreadCount(parseInt(attributes.getValue(idx))); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement memory.setMax(parseLong(attributes.getValue(idx))); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement threadinfo.setCurrentThreadsBusy(parseInt(attributes.getValue(idx))); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted