PiePlot plot = new PiePlot(dataset); plot.setLabelGenerator(new StandardPieSectionLabelGenerator()); plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0)); if (tooltips) { plot.setToolTipGenerator(new StandardPieToolTipGenerator()); } if (urls) { plot.setURLGenerator(new StandardPieURLGenerator()); } return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
PiePlot3D plot = new PiePlot3D(dataset); plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0)); if (tooltips) { plot.setToolTipGenerator(new StandardPieToolTipGenerator()); } if (urls) { plot.setURLGenerator(new StandardPieURLGenerator()); } return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java
Method name: JFreeChart createPieChart(String, PieDataset, boolean, boolean, boolean) Method name: JFreeChart createPieChart3D(String, PieDataset, boolean, boolean, boolean)
Number of AST nodes: 8 Number of AST nodes: 7
1
PiePlot plot = new PiePlot(dataset);
1
PiePlot3D plot = new PiePlot3D(dataset);
2
        plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
3
        plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
2
        plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
4
        if (tooltips) {
3
        if (tooltips) {
5
            plot.setToolTipGenerator(new StandardPieToolTipGenerator());
4
            plot.setToolTipGenerator(new StandardPieToolTipGenerator());
6
        }
5
        }
7
        if (urls) {
6
        if (urls) {
8
            plot.setURLGenerator(new StandardPieURLGenerator());
7
            plot.setURLGenerator(new StandardPieURLGenerator());
9
        }
8
        }
10
        return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, 
9
        return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, 
11
                legend);
10
                legend);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons21
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)70.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    PiePlot plot = new PiePlot(dataset);
    1
    PiePlot plot = new PiePlot(dataset);
    1
    PiePlot3D plot = new PiePlot3D(dataset);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.PiePlotorg.jfree.chart.plot.PiePlot3DSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.PiePlotorg.jfree.chart.plot.PiePlot3DSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.PiePlotorg.jfree.chart.plot.PiePlot3DSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new PiePlot(dataset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    PiePlot3D plot = new PiePlot3D(dataset);
    2
    plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
    2
    plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
    Preondition Violations
    Unmatched statement plot.setLabelGenerator(new StandardPieSectionLabelGenerator()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                        
    3
    plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
    3
    plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
    2
    plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.PiePlotorg.jfree.chart.plot.PiePlot3DSUBCLASS_TYPE_MISMATCH
    2
    plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
    4
    if (tooltips)
    3
    if (tooltips)
    5
    plot.setToolTipGenerator(new StandardPieToolTipGenerator());
    5
    plot.setToolTipGenerator(new StandardPieToolTipGenerator());
    4
    plot.setToolTipGenerator(new StandardPieToolTipGenerator());
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.PiePlotorg.jfree.chart.plot.PiePlot3DSUBCLASS_TYPE_MISMATCH
    4
    plot.setToolTipGenerator(new StandardPieToolTipGenerator());
    6
    if (urls)
    5
    if (urls)
    7
    plot.setURLGenerator(new StandardPieURLGenerator());
    7
    plot.setURLGenerator(new StandardPieURLGenerator());
    6
    plot.setURLGenerator(new StandardPieURLGenerator());
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.PiePlotorg.jfree.chart.plot.PiePlot3DSUBCLASS_TYPE_MISMATCH
    6
    plot.setURLGenerator(new StandardPieURLGenerator());
    8
    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    8
    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    7
    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.PiePlotorg.jfree.chart.plot.PiePlot3DSUBCLASS_TYPE_MISMATCH
    7
    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    Precondition Violations (2)
    Row Violation
    1Expression new PiePlot(dataset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched statement plot.setLabelGenerator(new StandardPieSectionLabelGenerator()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted