for (int c = 0; c < this.dataset.getColumnCount(); c++) { Comparable key = this.dataset.getColumnKey(c); Paint p = piePlot.getSectionPaint(key); if (p == null) { p = (Paint) this.sectionPaints.get(key); if (p == null) { p = getDrawingSupplier().getNextPaint(); } } this.sectionPaints.put(key, p); }
for (int r = 0; r < this.dataset.getRowCount(); r++) { Comparable key = this.dataset.getRowKey(r); Paint p = piePlot.getSectionPaint(key); if (p == null) { p = (Paint) this.sectionPaints.get(key); if (p == null) { p = getDrawingSupplier().getNextPaint(); } } this.sectionPaints.put(key, p); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MultiplePiePlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MultiplePiePlot.java
Method name: void prefetchSectionPaints() Method name: void prefetchSectionPaints()
Number of AST nodes: 8 Number of AST nodes: 8
1
for (int c = 0; c < this.dataset.getColumnCount(); c++) {
1
for (int r = 0; r < this.dataset.getRowCount(); r++) {
2
                Comparable key = this.dataset.getColumnKey(c);
2
                Comparable key = this.dataset.getRowKey(r);
3
                Paint p = piePlot.getSectionPaint(key);
3
                Paint p = piePlot.getSectionPaint(key);
4
                if (p == null) {
4
                if (p == null) {
5
                    p = (Paint) this.sectionPaints.get(key);
5
                    p = (Paint) this.sectionPaints.get(key);
6
                    if (p == null) {
6
                    if (p == null) {
7
                        p = getDrawingSupplier().getNextPaint();
7
                        p = getDrawingSupplier().getNextPaint();
8
                    }
8
                    }
9
                }
9
                }
10
                this.sectionPaints.put(key, p);
10
                this.sectionPaints.put(key, p);
11
            }
11
            }
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.3
Clones locationClones are in the same method
Number of node comparisons24
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)32.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    for (int c = 0; c < this.dataset.getColumnCount(); c++)
    3
    for (int c = 0; c < this.dataset.getColumnCount(); c++)
    11
    for (int r = 0; r < this.dataset.getRowCount(); r++)
    Differences
    Expression1Expression2Difference
    crVARIABLE_NAME_MISMATCH
    crVARIABLE_NAME_MISMATCH
    getColumnCountgetRowCountMETHOD_INVOCATION_NAME_MISMATCH
    crVARIABLE_NAME_MISMATCH
    11
    for (int r = 0; r < this.dataset.getRowCount(); r++)
    4
    Comparable key = this.dataset.getColumnKey(c);
    4
    Comparable key = this.dataset.getColumnKey(c);
    12
    Comparable key = this.dataset.getRowKey(r);
    Differences
    Expression1Expression2Difference
    crVARIABLE_NAME_MISMATCH
    getColumnKeygetRowKeyMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.dataset.getColumnKey(c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.dataset.getRowKey(r) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    Comparable key = this.dataset.getRowKey(r);
    5
    Paint p = piePlot.getSectionPaint(key);
    13
    Paint p = piePlot.getSectionPaint(key);
    6
    if (p == null)
    14
    if (p == null)
    7
    p = (Paint)this.sectionPaints.get(key);
    15
    p = (Paint)this.sectionPaints.get(key);
    8
    if (p == null)
    16
    if (p == null)
    9
    p = getDrawingSupplier().getNextPaint();
    17
    p = getDrawingSupplier().getNextPaint();
    10
    this.sectionPaints.put(key, p);
    18
    this.sectionPaints.put(key, p);
    Precondition Violations (2)
    Row Violation
    1Expression this.dataset.getColumnKey(c) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.dataset.getRowKey(r) cannot be parameterized, because it has dependencies to/from statements that will be extracted