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; }
for (int item = 0; item < itemCount; item++) { double value = dataset.getYValue(series, item); if (!Double.isNaN(value)) { minimum = Math.min(minimum, value); maximum = Math.max(maximum, value); } }
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/data/general/DatasetUtilities.java
Method name: void drawDomainTickBands(Graphics2D, Rectangle2D, List) Method name: Range iterateRangeBounds(XYDataset, boolean)
Number of AST nodes: 7 Number of AST nodes: 5
1
while (iterator.hasNext()) {
2
                ValueTick tick = (ValueTick) iterator.next();
1
for (int item = 0; item < itemCount; item++) {
3
                double current = tick.getValue();
2
                    double value = dataset.getYValue(
4
                if (fillBand) {
5
                    getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,
6
                            previous, current
3
series, item);
4
                    if (!Double.isNaN(value)) {
5
                        minimum = Math.min(minimum, value);
7
);
6
                        maximum = Math.max(maximum, value);
8
                }
7
            
9
        
8
        }
10
        previous = current;
9
    
11
                fillBand = !fillBand;
12
            }
10
            }
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.1
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    8
    ValueTick tick = (ValueTick)iterator.next();
                                                                                              
    9
    double current = tick.getValue();
                                                                        
                                                                                                    
    29
    double value = dataset.getYValue(series, item);
    Preondition Violations
    Unmatched statement double value=dataset.getYValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    29
    double value = dataset.getYValue(series, item);
    10
    if (fillBand)
    10
    if (fillBand)
    30
    if (!Double.isNaN(value))
    Differences
    Expression1Expression2Difference
    fillBand!Double.isNaN(value)TYPE_COMPATIBLE_REPLACEMENT
    30
    if (!Double.isNaN(value))
    11
    getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, current);
                                                                                                                                                                
                                                                            
    31
    minimum = Math.min(minimum, value);
                                                                            
    32
    maximum = Math.max(maximum, value);
    Precondition Violations (1)
    Row Violation
    1Unmatched statement double value=dataset.getYValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted