Iterator iterator = this.subplots.iterator(); while (iterator.hasNext()) { XYPlot plot = (XYPlot) iterator.next(); LegendItemCollection more = plot.getLegendItems(); result.addAll(more); }
super.setOrientation(orientation); Iterator iterator = this.subplots.iterator(); while (iterator.hasNext()) { XYPlot plot = (XYPlot) iterator.next(); plot.setOrientation(orientation); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeXYPlot.java
Method name: LegendItemCollection getLegendItems() Method name: void setOrientation(PlotOrientation)
Number of AST nodes: 5 Number of AST nodes: 5
1
super.setOrientation(orientation);
1
Iterator iterator = this.subplots.iterator();
2
        Iterator iterator = this.subplots.iterator();
2
                while (iterator.hasNext()) {
3
        while (iterator.hasNext()) {
3
                    XYPlot plot = (XYPlot) iterator.next();
4
            XYPlot plot = (XYPlot) iterator.next();
4
                    LegendItemCollection more = plot.getLegendItems();
5
            plot.set
5
                    result.addAll(more);
6
        
6
Orientation(orientation);
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)11.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                              
    1
    super.setOrientation(orientation);
    5
    Iterator iterator = this.subplots.iterator();
    2
    Iterator iterator = this.subplots.iterator();
    6
    while (iterator.hasNext())
    3
    while (iterator.hasNext())
    7
    XYPlot plot = (XYPlot)iterator.next();
    4
    XYPlot plot = (XYPlot)iterator.next();
                                                                            
    5
    plot.setOrientation(orientation);
    Preondition Violations
    Unmatched statement plot.setOrientation(orientation); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement plot.setOrientation(orientation); 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
    5
    plot.setOrientation(orientation);
    8
    LegendItemCollection more = plot.getLegendItems();
    8
    LegendItemCollection more = plot.getLegendItems();
    Preondition Violations
    Unmatched statement LegendItemCollection more=plot.getLegendItems(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                          
    9
    result.addAll(more);
    9
    result.addAll(more);
    Preondition Violations
    Unmatched statement result.addAll(more); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                  
    Precondition Violations (4)
    Row Violation
    1Unmatched statement plot.setOrientation(orientation); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement plot.setOrientation(orientation); 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
    3Unmatched statement LegendItemCollection more=plot.getLegendItems(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement result.addAll(more); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted