CombinedDomainXYPlot plot = new CombinedDomainXYPlot(); XYPlot plot1 = new XYPlot(); XYPlot plot2 = new XYPlot(); plot.add(plot1); plot.add(plot2); // remove plot2, but plot1 is removed instead plot.remove(plot2); List plots = plot.getSubplots(); assertTrue(plots.get(0) == plot1);
CombinedRangeXYPlot plot = new CombinedRangeXYPlot(); XYPlot plot1 = new XYPlot(); XYPlot plot2 = new XYPlot(); plot.add(plot1); plot.add(plot2); // remove plot2, but plot1 is removed instead plot.remove(plot2); List plots = plot.getSubplots(); assertTrue(plots.get(0) == plot1);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CombinedDomainXYPlotTests.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CombinedRangeXYPlotTests.java
Method name: void testRemoveSubplot() Method name: void testRemoveSubplot()
Number of AST nodes: 8 Number of AST nodes: 8
1
CombinedDomainXYPlot plot = new CombinedDomainXYPlot();
1
CombinedRangeXYPlot plot = new CombinedRangeXYPlot();
2
        XYPlot plot1 = new XYPlot();
2
        XYPlot plot1 = new XYPlot();
3
        XYPlot plot2 = new XYPlot();
3
        XYPlot plot2 = new XYPlot();
4
        plot.add(plot1);
4
        plot.add(plot1);
5
        plot.add(plot2);
5
        plot.add(plot2);
6
        // remove plot2, but plot1 is removed instead
6
        // remove plot2, but plot1 is removed instead
7
        plot.remove(plot2);
7
        plot.remove(plot2);
8
        List plots = plot.getSubplots();
8
        List plots = plot.getSubplots();
9
        assertTrue(plots.get(0) == plot1);
9
        assertTrue(plots.get(0) == plot1);
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons23
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    CombinedDomainXYPlot plot = new CombinedDomainXYPlot();
    1
    CombinedDomainXYPlot plot = new CombinedDomainXYPlot();
    1
    CombinedRangeXYPlot plot = new CombinedRangeXYPlot();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new CombinedDomainXYPlot() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new CombinedRangeXYPlot() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    CombinedRangeXYPlot plot = new CombinedRangeXYPlot();
    2
    XYPlot plot1 = new XYPlot();
    2
    XYPlot plot1 = new XYPlot();
    3
    XYPlot plot2 = new XYPlot();
    3
    XYPlot plot2 = new XYPlot();
    4
    plot.add(plot1);
    4
    plot.add(plot1);
    4
    plot.add(plot1);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.XYPlot does not declare member(s) public void add(org.jfree.chart.plot.XYPlot)
    4
    plot.add(plot1);
    5
    plot.add(plot2);
    5
    plot.add(plot2);
    5
    plot.add(plot2);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.XYPlot does not declare member(s) public void add(org.jfree.chart.plot.XYPlot)
    5
    plot.add(plot2);
    6
    plot.remove(plot2);
    6
    plot.remove(plot2);
    6
    plot.remove(plot2);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.XYPlot does not declare member(s) public void remove(org.jfree.chart.plot.XYPlot)
    6
    plot.remove(plot2);
    7
    List plots = plot.getSubplots();
    7
    List plots = plot.getSubplots();
    7
    List plots = plot.getSubplots();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedDomainXYPlotorg.jfree.chart.plot.CombinedRangeXYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.XYPlot does not declare member(s) public List#RAW getSubplots()
    7
    List plots = plot.getSubplots();
    8
    assertTrue(plots.get(0) == plot1);
    8
    assertTrue(plots.get(0) == plot1);
    Precondition Violations (6)
    Row Violation
    1Expression new CombinedDomainXYPlot() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new CombinedRangeXYPlot() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.XYPlot does not declare member(s) public void add(org.jfree.chart.plot.XYPlot)
    4Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.XYPlot does not declare member(s) public void add(org.jfree.chart.plot.XYPlot)
    5Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.XYPlot does not declare member(s) public void remove(org.jfree.chart.plot.XYPlot)
    6Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.XYPlot does not declare member(s) public List#RAW getSubplots()