for (int i = entityCount - 1; i >= 0; i--) { ChartEntity entity = (ChartEntity) this.entities.get(i); if (entity.getArea().contains(x, y)) { return entity; } }
for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { XYSeries dataSeries = (XYSeries) this.data.get(seriesNo); if (!dataSeries.equals(series)) { dataSeries.add(xValue, null); } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/StandardEntityCollection.java File path: /jfreechart-1.0.10/src/org/jfree/data/xy/DefaultTableXYDataset.java
Method name: ChartEntity getEntity(double, double) Method name: void updateXPoints(XYSeries)
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int i = entityCount - 1; i &gt;= 0; i--) {
1
for (int seriesNo = 0; seriesNo &lt;
2
            ChartEntity entity = (ChartEntity) this.entities.get(i);
2
 seriesCount; seriesNo++) {
3
                    XYSeries dataSeries = (XYSeries) this.data.get(seriesNo);
3
            if (entity.getArea().contains(x, y)) {
4
                    if (
4
                return entity;
5
            }
5
!dataSeries.equals(series)) {
6
                        dataSeries.add(xValue, null);
7
                    }
6
        }
8
                }
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.4
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)14.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    ChartEntity entity = (ChartEntity)this.entities.get(i);
    3
    ChartEntity entity = (ChartEntity)this.entities.get(i);
    Preondition Violations
    Unmatched statement ChartEntity entity=(ChartEntity)this.entities.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                    
                                                                                                                        
    13
    XYSeries dataSeries = (XYSeries)this.data.get(seriesNo);
    Preondition Violations
    Unmatched statement XYSeries dataSeries=(XYSeries)this.data.get(seriesNo); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    13
    XYSeries dataSeries = (XYSeries)this.data.get(seriesNo);
    4
    if (entity.getArea().contains(x, y))
    4
    if (entity.getArea().contains(x, y))
    14
    if (!dataSeries.equals(series))
    Differences
    Expression1Expression2Difference
    entity.getArea().contains(x,y)!dataSeries.equals(series)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression entity.getArea().contains(x,y) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression !dataSeries.equals(series) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!dataSeries.equals(series))
    5
    return entity;
    5
    return entity;
    Preondition Violations
    Unmatched statement return entity; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return entity;
                                      
                                                                    
    15
    dataSeries.add(xValue, null);
    Preondition Violations
    Unmatched statement dataSeries.add(xValue,null); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement dataSeries.add(xValue,null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    15
    dataSeries.add(xValue, null);
    Precondition Violations (9)
    Row Violation
    1Unmatched statement ChartEntity entity=(ChartEntity)this.entities.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement XYSeries dataSeries=(XYSeries)this.data.get(seriesNo); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression entity.getArea().contains(x,y) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression !dataSeries.equals(series) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement return entity; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched return entity;
    7Unmatched statement dataSeries.add(xValue,null); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Unmatched statement dataSeries.add(xValue,null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    9The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero