ValueTick tick = (ValueTick) iterator.next(); double current = tick.getValue(); if (fillBand) { getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, current); } previous = current; fillBand = !fillBand;
ValueTick tick = (ValueTick) iterator.next(); double current = tick.getValue(); if (fillBand) { getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, current); } previous = current; fillBand = !fillBand;
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: 6 Number of AST nodes: 6
1
ValueTick tick = (ValueTick) iterator.next();
1
ValueTick tick = (ValueTick) iterator.next();
2
                double current = tick.getValue();
2
                double current = tick.getValue();
3
                if (fillBand) {
3
                if (fillBand) {
4
                    getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,
4
                    getRenderer().fillRangeGridBand(g2, this, axis, dataArea,
5
                            previous, current);
5
                            previous, current);
6
                }
6
                }
7
                previous = current;
7
                previous = current;
8
                fillBand = !fillBand;
8
                fillBand = !fillBand;
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 declared in the same class
Number of node comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)13.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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
    xAxisaxisVARIABLE_NAME_MISMATCH
    fillDomainGridBandfillRangeGridBandMETHOD_INVOCATION_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;
    Precondition Violations (5)
    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
    5Clone fragment #1 returns variables fillBand, previous , while Clone fragment #2 returns variables fillBand, previous