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 statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)3.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    synchronized (tableRows)
    3
    synchronized (tableRows)
                                                                                                
    4
    row = (Calculator)tableRows.get(sampleLabel);
    Preondition Violations
    Unmatched statement row=(Calculator)tableRows.get(sampleLabel); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    row = (Calculator)tableRows.get(sampleLabel);
    4
    row = (SamplingStatCalculator)tableRows.get(sampleLabel);
    4
    row = (SamplingStatCalculator)tableRows.get(sampleLabel);
    Preondition Violations
    Unmatched statement row=(SamplingStatCalculator)tableRows.get(sampleLabel); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                        
    5
    if (row == null)
    5
    if (row == null)
    5
    if (row == null)
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.visualizers.SamplingStatCalculatororg.apache.jmeter.util.CalculatorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.util.Calculator of variable row
    • Make classes org.apache.jmeter.visualizers.SamplingStatCalculator and org.apache.jmeter.util.Calculator extend a common superclass
    5
    if (row == null)
                                                                          
    6
    row = new Calculator(sampleLabel);
    Preondition Violations
    Unmatched statement row=new Calculator(sampleLabel); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    row = new Calculator(sampleLabel);
    6
    row = new SamplingStatCalculator(sampleLabel);
    6
    row = new SamplingStatCalculator(sampleLabel);
    Preondition Violations
    Unmatched statement row=new SamplingStatCalculator(sampleLabel); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                  
    7
    tableRows.put(row.getLabel(), row);
    7
    tableRows.put(row.getLabel(), row);
    7
    tableRows.put(row.getLabel(), row);
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.visualizers.SamplingStatCalculatororg.apache.jmeter.util.CalculatorVARIABLE_TYPE_MISMATCH
    org.apache.jmeter.visualizers.SamplingStatCalculatororg.apache.jmeter.util.CalculatorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.util.Calculator of variable row
    • Make classes org.apache.jmeter.visualizers.SamplingStatCalculator and org.apache.jmeter.util.Calculator extend a common superclass
    Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.util.Calculator of variable row
    • Make classes org.apache.jmeter.visualizers.SamplingStatCalculator and org.apache.jmeter.util.Calculator extend a common superclass
    7
    tableRows.put(row.getLabel(), row);
    8
    model.insertRow(row, model.getRowCount() - 1);
    8
    model.insertRow(row, model.getRowCount() - 1);
    8
    model.insertRow(row, model.getRowCount() - 1);
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.visualizers.SamplingStatCalculatororg.apache.jmeter.util.CalculatorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.util.Calculator of variable row
    • Make classes org.apache.jmeter.visualizers.SamplingStatCalculator and org.apache.jmeter.util.Calculator extend a common superclass
    8
    model.insertRow(row, model.getRowCount() - 1);
    Precondition Violations (8)
    Row Violation
    1Unmatched statement row=(Calculator)tableRows.get(sampleLabel); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement row=(SamplingStatCalculator)tableRows.get(sampleLabel); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.util.Calculator of variable row
    4Unmatched statement row=new Calculator(sampleLabel); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement row=new SamplingStatCalculator(sampleLabel); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.util.Calculator of variable row
    7Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.util.Calculator of variable row
    8Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.util.Calculator of variable row