synchronized (tableRows) { row = (SamplingStatCalculator) tableRows.get(sampleLabel); if (row == null) { row = new SamplingStatCalculator(sampleLabel); tableRows.put(row.getLabel(), row); model.insertRow(row, model.getRowCount() - 1); } }
synchronized (tableRows) { row = (Calculator) tableRows.get(sampleLabel); if (row == null) { row = new Calculator(sampleLabel); tableRows.put(row.getLabel(), row); model.insertRow(row, model.getRowCount() - 1); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/StatVisualizer.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/SummaryReport.java
Method name: void add(SampleResult) Method name: void add(SampleResult)
Number of AST nodes: 6 Number of AST nodes: 6
1
synchronized (tableRows) {
1
synchronized (tableRows) {
2
            row = (SamplingStatCalculator) tableRows.get(sampleLabel);
2
            row = (Calculator) tableRows.get(sampleLabel);
3
			if (row == null) {
3
			if (row == null) {
4
				row = new SamplingStatCalculator(sampleLabel);
4
				row = new Calculator(sampleLabel);
5
				tableRows.put(row.getLabel(), row);
5
				tableRows.put(row.getLabel(), row);
6
				model.insertRow(row, model.getRowCount() - 1);
6
				model.insertRow(row, model.getRowCount() - 1);
7
			}
7
			}
8
		}
8
		}
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 different classes having the same super class
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    3
    synchronized (tableRows)
    3
    synchronized (tableRows)
    4
    row = (SamplingStatCalculator)tableRows.get(sampleLabel);
    4
    row = (Calculator)tableRows.get(sampleLabel);
    5
    if (row == null)
    5
    if (row == null)
    6
    row = new SamplingStatCalculator(sampleLabel);
    6
    row = new Calculator(sampleLabel);
    7
    tableRows.put(row.getLabel(), row);
    7
    tableRows.put(row.getLabel(), row);
    8
    model.insertRow(row, model.getRowCount() - 1);
    8
    model.insertRow(row, model.getRowCount() - 1);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variable row with type org.apache.jmeter.visualizers.SamplingStatCalculator , while Clone fragment #2 returns variable row with type org.apache.jmeter.util.Calculator