if (autoPopulate) { DrawingSupplier ds = getDrawingSupplier(); if (ds != null) { result = ds.getNextPaint(); this.sectionPaintMap.put(key, result); } else { result = this.baseSectionPaint; } } else { result = this.baseSectionPaint; }
if (autoPopulate) { DrawingSupplier ds = getDrawingSupplier(); if (ds != null) { result = ds.getNextOutlinePaint(); this.sectionOutlinePaintMap.put(key, result); } else { result = this.baseSectionOutlinePaint; } } else { result = this.baseSectionOutlinePaint; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot.java
Method name: Paint lookupSectionPaint(Comparable, boolean) Method name: Paint lookupSectionOutlinePaint(Comparable, boolean)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (autoPopulate) {
1
if (autoPopulate) {
2
            DrawingSupplier ds = getDrawingSupplier();
2
            DrawingSupplier ds = getDrawingSupplier();
3
            if (ds != null) {
3
            if (ds != null) {
4
                result = ds.getNextPaint();
4
                result = ds.getNextOutlinePaint();
5
                this.sectionPaintMap.put(key, result);
5
                this.sectionOutlinePaintMap.put(key, result);
6
            }
6
            }
7
            else {
7
            else {
8
                result = this.baseSectionPaint;
8
                result = this.baseSectionOutlinePaint;
9
            }
9
            }
10
        }
10
        }
11
        else {
11
        else {
12
            result = this.baseSectionPaint;
12
            result = this.baseSectionOutlinePaint;
13
        }
13
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)19.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    if (autoPopulate)
    7
    if (autoPopulate)
    8
    DrawingSupplier ds = getDrawingSupplier();
    8
    DrawingSupplier ds = getDrawingSupplier();
    9
    if (ds != null)
    9
    if (ds != null)
    10
    result = ds.getNextPaint();
    10
    result = ds.getNextPaint();
    10
    result = ds.getNextOutlinePaint();
    Differences
    Expression1Expression2Difference
    getNextPaintgetNextOutlinePaintMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression ds.getNextPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.getNextOutlinePaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    result = ds.getNextOutlinePaint();
    11
    this.sectionPaintMap.put(key, result);
    11
    this.sectionPaintMap.put(key, result);
    11
    this.sectionOutlinePaintMap.put(key, result);
    Differences
    Expression1Expression2Difference
    sectionPaintMapsectionOutlinePaintMapVARIABLE_NAME_MISMATCH
    11
    this.sectionOutlinePaintMap.put(key, result);
    else
    else
    12
    result = this.baseSectionPaint;
    12
    result = this.baseSectionPaint;
    12
    result = this.baseSectionOutlinePaint;
    Differences
    Expression1Expression2Difference
    baseSectionPaintbaseSectionOutlinePaintVARIABLE_NAME_MISMATCH
    12
    result = this.baseSectionOutlinePaint;
    else
    else
    13
    result = this.baseSectionPaint;
    13
    result = this.baseSectionPaint;
    13
    result = this.baseSectionOutlinePaint;
    Differences
    Expression1Expression2Difference
    baseSectionPaintbaseSectionOutlinePaintVARIABLE_NAME_MISMATCH
    13
    result = this.baseSectionOutlinePaint;
    Precondition Violations (2)
    Row Violation
    1Expression ds.getNextPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ds.getNextOutlinePaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted