boolean fillBand = false; ValueAxis xAxis = getDomainAxis(); double previous = xAxis.getLowerBound(); Iterator iterator = ticks.iterator(); while (iterator.hasNext()) { ValueTick tick = (ValueTick) iterator.next(); double current = tick.getValue(); if (fillBand) { getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, current); } previous = current; fillBand = !fillBand; } double end = xAxis.getUpperBound(); if (fillBand) { getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, end); }
boolean fillBand = false; ValueAxis axis = getRangeAxis(); double previous = axis.getLowerBound(); Iterator iterator = ticks.iterator(); while (iterator.hasNext()) { ValueTick tick = (ValueTick) iterator.next(); double current = tick.getValue(); if (fillBand) { getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, current); } previous = current; fillBand = !fillBand; } double end = axis.getUpperBound(); if (fillBand) { getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, end); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: void drawDomainTickBands(Graphics2D, Rectangle2D, List) Method name: void drawRangeTickBands(Graphics2D, Rectangle2D, List)
Number of AST nodes: 14 Number of AST nodes: 14
1
boolean fillBand = false;
1
boolean fillBand = false;
2
            ValueAxis xAxis = getDomainAxis();
2
            ValueAxis axis = getRangeAxis();
3
            double previous = xAxis.getLowerBound();
3
            double previous = axis.getLowerBound();
4
            Iterator iterator = ticks.iterator();
4
            Iterator iterator = ticks.iterator();
5
            while (iterator.hasNext()) {
5
            while (iterator.hasNext()) {
6
                ValueTick tick = (ValueTick) iterator.next();
6
                ValueTick tick = (ValueTick) iterator.next();
7
                double current = tick.getValue();
7
                double current = tick.getValue();
8
                if (fillBand) {
8
                if (fillBand) {
9
                    getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,
9
                    getRenderer().fillRangeGridBand(g2, this, axis, dataArea,
10
                            previous, current);
10
                            previous, current);
11
                }
11
                }
12
                previous = current;
12
                previous = current;
13
                fillBand = !fillBand;
13
                fillBand = !fillBand;
14
            }
14
            }
15
            double end = xAxis.getUpperBound();
15
            double end = axis.getUpperBound();
16
            if (fillBand) {
16
            if (fillBand) {
17
                getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,
17
                getRenderer().fillRangeGridBand(g2, this, axis, dataArea,
18
                        previous, end);
18
                        previous, end);
19
            }
19
            }
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.3
Clones locationClones are declared in the same class
Number of node comparisons59
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)9.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    boolean fillBand = false;
    3
    boolean fillBand = false;
    4
    ValueAxis xAxis = getDomainAxis();
    4
    ValueAxis xAxis = getDomainAxis();
    4
    ValueAxis axis = getRangeAxis();
    Differences
    Expression1Expression2Difference
    xAxisaxisVARIABLE_NAME_MISMATCH
    getDomainAxisgetRangeAxisMETHOD_INVOCATION_NAME_MISMATCH
    4
    ValueAxis axis = getRangeAxis();
    5
    double previous = xAxis.getLowerBound();
    5
    double previous = xAxis.getLowerBound();
    5
    double previous = axis.getLowerBound();
    Differences
    Expression1Expression2Difference
    xAxisaxisVARIABLE_NAME_MISMATCH
    5
    double previous = axis.getLowerBound();
    6
    Iterator iterator = ticks.iterator();
    6
    Iterator iterator = ticks.iterator();
    7
    while (iterator.hasNext())
    7
    while (iterator.hasNext())
    8
    ValueTick tick = (ValueTick)iterator.next();
    8
    ValueTick tick = (ValueTick)iterator.next();
    9
    double current = tick.getValue();
    9
    double current = tick.getValue();
    10
    if (fillBand)
    10
    if (fillBand)
    11
    getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, current);
    11
    getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, current);
    11
    getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, current);
    Differences
    Expression1Expression2Difference
    fillDomainGridBandfillRangeGridBandMETHOD_INVOCATION_NAME_MISMATCH
    xAxisaxisVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getRenderer().fillDomainGridBand(g2,this,xAxis,dataArea,previous,current) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getRenderer().fillRangeGridBand(g2,this,axis,dataArea,previous,current) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getRenderer().fillDomainGridBand(g2,this,xAxis,dataArea,previous,current) is a void method call, and thus it cannot be parameterized
    Expression getRenderer().fillRangeGridBand(g2,this,axis,dataArea,previous,current) is a void method call, and thus it cannot be parameterized
    11
    getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, current);
    12
    previous = current;
    12
    previous = current;
    13
    fillBand = !fillBand;
    13
    fillBand = !fillBand;
    14
    double end = xAxis.getUpperBound();
    14
    double end = xAxis.getUpperBound();
    14
    double end = axis.getUpperBound();
    Differences
    Expression1Expression2Difference
    xAxisaxisVARIABLE_NAME_MISMATCH
    14
    double end = axis.getUpperBound();
    15
    if (fillBand)
    15
    if (fillBand)
    16
    getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, end);
    16
    getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, end);
    16
    getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, end);
    Differences
    Expression1Expression2Difference
    fillDomainGridBandfillRangeGridBandMETHOD_INVOCATION_NAME_MISMATCH
    xAxisaxisVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getRenderer().fillDomainGridBand(g2,this,xAxis,dataArea,previous,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getRenderer().fillRangeGridBand(g2,this,axis,dataArea,previous,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getRenderer().fillDomainGridBand(g2,this,xAxis,dataArea,previous,end) is a void method call, and thus it cannot be parameterized
    Expression getRenderer().fillRangeGridBand(g2,this,axis,dataArea,previous,end) is a void method call, and thus it cannot be parameterized
    16
    getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, end);
    Precondition Violations (8)
    Row Violation
    1Expression getRenderer().fillDomainGridBand(g2,this,xAxis,dataArea,previous,current) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getRenderer().fillRangeGridBand(g2,this,axis,dataArea,previous,current) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression getRenderer().fillDomainGridBand(g2,this,xAxis,dataArea,previous,current) is a void method call, and thus it cannot be parameterized
    4Expression getRenderer().fillRangeGridBand(g2,this,axis,dataArea,previous,current) is a void method call, and thus it cannot be parameterized
    5Expression getRenderer().fillDomainGridBand(g2,this,xAxis,dataArea,previous,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression getRenderer().fillRangeGridBand(g2,this,axis,dataArea,previous,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression getRenderer().fillDomainGridBand(g2,this,xAxis,dataArea,previous,end) is a void method call, and thus it cannot be parameterized
    8Expression getRenderer().fillRangeGridBand(g2,this,axis,dataArea,previous,end) is a void method call, and thus it cannot be parameterized