Iterator iterator = getAnnotations().iterator(); while (iterator.hasNext()) { CategoryAnnotation annotation = (CategoryAnnotation) iterator.next(); annotation.draw(g2, this, dataArea, getDomainAxis(), getRangeAxis()); }
Iterator iterator = ticks.iterator(); while (iterator.hasNext()) { ValueTick tick = (ValueTick) iterator.next(); getRenderer().drawDomainGridLine(g2, this, getDomainAxis(), dataArea, tick.getValue()); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: void drawAnnotations(Graphics2D, Rectangle2D) Method name: void drawDomainGridlines(Graphics2D, Rectangle2D, List)
Number of AST nodes: 4 Number of AST nodes: 4
1
Iterator iterator = getAnnotations().iterator();
1
Iterator iterator = ticks.iterator();
2
            while (iterator.hasNext()) {
2
                while (iterator.hasNext()) {
3
                CategoryAnnotation annotation
3
                
4
                        = (CategoryAnnotation) iterator.next();
5
                annotation.draw(g2, this, dataArea
4
    ValueTick tick = (ValueTick) iterator.next();
6
, getDomainAxis(),
5
                    getRenderer().drawDomainGridLine(g2, this, getDomainAxis(),
7
                        getRangeAxis());
6
                            dataArea, tick.getValue());
8
            }
7
                }
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 in different classes having the same super class
Number of node comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)4.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    Iterator iterator = getAnnotations().iterator();
    2
    Iterator iterator = getAnnotations().iterator();
    7
    Iterator iterator = ticks.iterator();
    Differences
    Expression1Expression2Difference
    getAnnotations()ticksTYPE_COMPATIBLE_REPLACEMENT
    7
    Iterator iterator = ticks.iterator();
    3
    while (iterator.hasNext())
    8
    while (iterator.hasNext())
    4
    CategoryAnnotation annotation = (CategoryAnnotation)iterator.next();
    4
    CategoryAnnotation annotation = (CategoryAnnotation)iterator.next();
    Preondition Violations
    Unmatched statement CategoryAnnotation annotation=(CategoryAnnotation)iterator.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                              
    5
    annotation.draw(g2, this, dataArea, getDomainAxis(), getRangeAxis());
                                                                                                                                            
                                                                                              
    9
    ValueTick tick = (ValueTick)iterator.next();
    Preondition Violations
    Unmatched statement ValueTick tick=(ValueTick)iterator.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9
    ValueTick tick = (ValueTick)iterator.next();
                                                                                                                                                                                  
    10
    getRenderer().drawDomainGridLine(g2, this, getDomainAxis(), dataArea, tick.getValue());
    Precondition Violations (2)
    Row Violation
    1Unmatched statement CategoryAnnotation annotation=(CategoryAnnotation)iterator.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement ValueTick tick=(ValueTick)iterator.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted