if (this.stroke != null) { return this.stroke; } // otherwise look up the paint table Stroke result = getSeriesStroke(series); if (result == null && this.autoPopulateSeriesStroke) { DrawingSupplier supplier = getDrawingSupplier(); if (supplier != null) { result = supplier.getNextStroke(); setSeriesStroke(series, result, false); } } if (result == null) { result = this.baseStroke; } return result;
if (this.outlineStroke != null) { return this.outlineStroke; } // otherwise look up the stroke table Stroke result = getSeriesOutlineStroke(series); if (result == null && this.autoPopulateSeriesOutlineStroke) { DrawingSupplier supplier = getDrawingSupplier(); if (supplier != null) { result = supplier.getNextOutlineStroke(); setSeriesOutlineStroke(series, result, false); } } if (result == null) { result = this.baseOutlineStroke; } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/AbstractRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/AbstractRenderer.java
Method name: Stroke lookupSeriesStroke(int) Method name: Stroke lookupSeriesOutlineStroke(int)
Number of AST nodes: 11 Number of AST nodes: 11
1
if (this.stroke != null) {
1
if (this.outlineStroke != null) {
2
            return this.stroke;
2
            return this.outlineStroke;
3
        }
3
        }
4
        // otherwise look up the paint table
4
        // otherwise look up the stroke table
5
        Stroke result = getSeriesStroke(series);
5
        Stroke result = getSeriesOutlineStroke(series);
6
        if (result == null && this.autoPopulateSeriesStroke) {
6
        if (result == null && this.autoPopulateSeriesOutlineStroke) {
7
            DrawingSupplier supplier = getDrawingSupplier();
7
            DrawingSupplier supplier = getDrawingSupplier();
8
            if (supplier != null) {
8
            if (supplier != null) {
9
                result = supplier.getNextStroke();
9
                result = supplier.getNextOutlineStroke();
10
                setSeriesStroke(series, result, false);
10
                setSeriesOutlineStroke(series, result, false);
11
            }
11
            }
12
        }
12
        }
13
        if (result == null) {
13
        if (result == null) {
14
            result = this.baseStroke;
14
            result = this.baseOutlineStroke;
15
        }
15
        }
16
        return result;
16
        return result;
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.6
Clones locationClones are declared in the same class
Number of node comparisons27
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)12.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this.stroke != null)
    1
    if (this.stroke != null)
    1
    if (this.outlineStroke != null)
    Differences
    Expression1Expression2Difference
    strokeoutlineStrokeVARIABLE_NAME_MISMATCH
    1
    if (this.outlineStroke != null)
    2
    return this.stroke;
    2
    return this.stroke;
    2
    return this.outlineStroke;
    Differences
    Expression1Expression2Difference
    strokeoutlineStrokeVARIABLE_NAME_MISMATCH
    2
    return this.outlineStroke;
    3
    Stroke result = getSeriesStroke(series);
    3
    Stroke result = getSeriesStroke(series);
    3
    Stroke result = getSeriesOutlineStroke(series);
    Differences
    Expression1Expression2Difference
    getSeriesStrokegetSeriesOutlineStrokeMETHOD_INVOCATION_NAME_MISMATCH
    3
    Stroke result = getSeriesOutlineStroke(series);
    4
    if (result == null && this.autoPopulateSeriesStroke)
    4
    if (result == null && this.autoPopulateSeriesStroke)
    4
    if (result == null && this.autoPopulateSeriesOutlineStroke)
    Differences
    Expression1Expression2Difference
    autoPopulateSeriesStrokeautoPopulateSeriesOutlineStrokeVARIABLE_NAME_MISMATCH
    4
    if (result == null && this.autoPopulateSeriesOutlineStroke)
    5
    DrawingSupplier supplier = getDrawingSupplier();
    5
    DrawingSupplier supplier = getDrawingSupplier();
    6
    if (supplier != null)
    6
    if (supplier != null)
    7
    result = supplier.getNextStroke();
    7
    result = supplier.getNextStroke();
    7
    result = supplier.getNextOutlineStroke();
    Differences
    Expression1Expression2Difference
    getNextStrokegetNextOutlineStrokeMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression supplier.getNextStroke() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression supplier.getNextOutlineStroke() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    result = supplier.getNextOutlineStroke();
    8
    setSeriesStroke(series, result, false);
    8
    setSeriesStroke(series, result, false);
    8
    setSeriesOutlineStroke(series, result, false);
    Differences
    Expression1Expression2Difference
    setSeriesStrokesetSeriesOutlineStrokeMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression setSeriesStroke(series,result,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setSeriesOutlineStroke(series,result,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setSeriesStroke(series,result,false) is a void method call, and thus it cannot be parameterized
    Expression setSeriesOutlineStroke(series,result,false) is a void method call, and thus it cannot be parameterized
    8
    setSeriesOutlineStroke(series, result, false);
    9
    if (result == null)
    9
    if (result == null)
    10
    result = this.baseStroke;
    10
    result = this.baseStroke;
    10
    result = this.baseOutlineStroke;
    Differences
    Expression1Expression2Difference
    baseStrokebaseOutlineStrokeVARIABLE_NAME_MISMATCH
    10
    result = this.baseOutlineStroke;
    11
    return result;
    11
    return result;
    Precondition Violations (6)
    Row Violation
    1Expression supplier.getNextStroke() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression supplier.getNextOutlineStroke() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression setSeriesStroke(series,result,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression setSeriesOutlineStroke(series,result,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression setSeriesStroke(series,result,false) is a void method call, and thus it cannot be parameterized
    6Expression setSeriesOutlineStroke(series,result,false) is a void method call, and thus it cannot be parameterized