Iterator iterator = getAnnotations().iterator(); while (iterator.hasNext()) { CategoryAnnotation annotation = (CategoryAnnotation) iterator.next(); annotation.draw(g2, this, dataArea, getDomainAxis(), getRangeAxis()); }
Iterator iterator = this.domainMarkers.iterator(); while (iterator.hasNext()) { Marker marker = (Marker) iterator.next(); drawDomainMarker(g2, this, getDomainAxis(), marker, dataArea); }
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/ContourPlot.java
Method name: void drawAnnotations(Graphics2D, Rectangle2D) Method name: void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)
Number of AST nodes: 4 Number of AST nodes: 4
1
Iterator iterator = getAnnotations().iterator();
1
Iterator iterator = this.domainMarkers.iterator();
2
            while (iterator.hasNext()) {
2
            while (iterator.hasNext()) {
3
                CategoryAnnotation annotation
3
                
4
                        = (CategoryAnnotation) iterator.next();
4
Marker marker = (Marker) iterator.next();
5
                annotation.draw(g2, this, dataArea, getDomainAxis(),
5
                drawDomainMarker(g2, this, getDomainAxis(),
6
                        getRangeAxis());
6
 marker, dataArea);
7
            }
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.8
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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    Iterator iterator = getAnnotations().iterator();
    2
    Iterator iterator = getAnnotations().iterator();
    56
    Iterator iterator = this.domainMarkers.iterator();
    Differences
    Expression1Expression2Difference
    getAnnotations()this.domainMarkersTYPE_COMPATIBLE_REPLACEMENT
    56
    Iterator iterator = this.domainMarkers.iterator();
    3
    while (iterator.hasNext())
    57
    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());
                                                                                                                                            
                                                                                        
    58
    Marker marker = (Marker)iterator.next();
    Preondition Violations
    Unmatched statement Marker marker=(Marker)iterator.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    58
    Marker marker = (Marker)iterator.next();
                                                                                                                                
    59
    drawDomainMarker(g2, this, getDomainAxis(), marker, dataArea);
    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 Marker marker=(Marker)iterator.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted