CombinedDomainCategoryPlot plot = createPlot(); JFreeChart chart = new JFreeChart(plot); chart.addChangeListener(this); CategoryPlot subplot1 = (CategoryPlot) plot.getSubplots().get(0); NumberAxis yAxis = (NumberAxis) subplot1.getRangeAxis(); yAxis.setAutoRangeIncludesZero(!yAxis.getAutoRangeIncludesZero()); assertEquals(1, this.events.size()); // a redraw should NOT trigger another change event BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB); Graphics2D g2 = image.createGraphics(); this.events.clear(); chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0)); assertTrue(this.events.isEmpty());
CombinedDomainXYPlot plot = createPlot(); JFreeChart chart = new JFreeChart(plot); chart.addChangeListener(this); XYPlot subplot1 = (XYPlot) plot.getSubplots().get(0); NumberAxis yAxis = (NumberAxis) subplot1.getRangeAxis(); yAxis.setAutoRangeIncludesZero(!yAxis.getAutoRangeIncludesZero()); assertEquals(1, this.events.size()); // a redraw should NOT trigger another change event BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB); Graphics2D g2 = image.createGraphics(); this.events.clear(); chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0)); assertTrue(this.events.isEmpty());
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CombinedDomainCategoryPlotTests.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CombinedDomainXYPlotTests.java
Method name: void testNotification() Method name: void testNotification()
Number of AST nodes: 12 Number of AST nodes: 12
1
CombinedDomainCategoryPlot plot = createPlot();
1
CombinedDomainXYPlot plot = createPlot();
2
        JFreeChart chart = new JFreeChart(plot);
2
        JFreeChart chart = new JFreeChart(plot);
3
        chart.addChangeListener(this);
3
        chart.addChangeListener(this);
4
        CategoryPlot subplot1 = (CategoryPlot) plot.getSubplots().get(0);
4
        XYPlot subplot1 = (XYPlot) plot.getSubplots().get(0);
5
        NumberAxis yAxis = (NumberAxis) subplot1.getRangeAxis();
5
        NumberAxis yAxis = (NumberAxis) subplot1.getRangeAxis();
6
        yAxis.setAutoRangeIncludesZero(!yAxis.getAutoRangeIncludesZero());
6
        yAxis.setAutoRangeIncludesZero(!yAxis.getAutoRangeIncludesZero());
7
        assertEquals(1, this.events.size());
7
        assertEquals(1, this.events.size());
8
        
8
        
9
        // a redraw should NOT trigger another change event
9
        // a redraw should NOT trigger another change event
10
        BufferedImage image = new BufferedImage(200, 100, 
10
        BufferedImage image = new BufferedImage(200, 100, 
11
                BufferedImage.TYPE_INT_RGB);
11
                BufferedImage.TYPE_INT_RGB);
12
        Graphics2D g2 = image.createGraphics();
12
        Graphics2D g2 = image.createGraphics();
13
        this.events.clear();
13
        this.events.clear();
14
        chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0));
14
        chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0));
15
        assertTrue(this.events.isEmpty());
15
        assertTrue(this.events.isEmpty());
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 comparisons61
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    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
    CombinedDomainCategoryPlot plot = createPlot();
    1
    CombinedDomainCategoryPlot plot = createPlot();
    1
    CombinedDomainXYPlot plot = createPlot();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedDomainCategoryPlotorg.jfree.chart.plot.CombinedDomainXYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CombinedDomainCategoryPlotorg.jfree.chart.plot.CombinedDomainXYPlotSUBCLASS_TYPE_MISMATCH
    1
    CombinedDomainXYPlot plot = createPlot();
    2
    JFreeChart chart = new JFreeChart(plot);
    2
    JFreeChart chart = new JFreeChart(plot);
    2
    JFreeChart chart = new JFreeChart(plot);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedDomainCategoryPlotorg.jfree.chart.plot.CombinedDomainXYPlotSUBCLASS_TYPE_MISMATCH
    2
    JFreeChart chart = new JFreeChart(plot);
    3
    chart.addChangeListener(this);
    3
    chart.addChangeListener(this);
    4
    CategoryPlot subplot1 = (CategoryPlot)plot.getSubplots().get(0);
    4
    CategoryPlot subplot1 = (CategoryPlot)plot.getSubplots().get(0);
    4
    XYPlot subplot1 = (XYPlot)plot.getSubplots().get(0);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CombinedDomainCategoryPlotorg.jfree.chart.plot.CombinedDomainXYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (CategoryPlot)plot.getSubplots().get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (XYPlot)plot.getSubplots().get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public List#RAW getSubplots()
    4
    XYPlot subplot1 = (XYPlot)plot.getSubplots().get(0);
    5
    NumberAxis yAxis = (NumberAxis)subplot1.getRangeAxis();
    5
    NumberAxis yAxis = (NumberAxis)subplot1.getRangeAxis();
    5
    NumberAxis yAxis = (NumberAxis)subplot1.getRangeAxis();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression subplot1 cannot be unified with expression subplot1 , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.chart.axis.ValueAxis getRangeAxis()
    5
    NumberAxis yAxis = (NumberAxis)subplot1.getRangeAxis();
    6
    yAxis.setAutoRangeIncludesZero(!yAxis.getAutoRangeIncludesZero());
    6
    yAxis.setAutoRangeIncludesZero(!yAxis.getAutoRangeIncludesZero());
    7
    assertEquals(1, this.events.size());
    7
    assertEquals(1, this.events.size());
    8
    BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
    8
    BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
    9
    Graphics2D g2 = image.createGraphics();
    9
    Graphics2D g2 = image.createGraphics();
    10
    this.events.clear();
    10
    this.events.clear();
    11
    chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0));
    11
    chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0));
    12
    assertTrue(this.events.isEmpty());
    12
    assertTrue(this.events.isEmpty());
    Precondition Violations (4)
    Row Violation
    1Expression (CategoryPlot)plot.getSubplots().get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (XYPlot)plot.getSubplots().get(0) 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.Plot does not declare member(s) public List#RAW getSubplots()
    4Expression subplot1 cannot be unified with expression subplot1 , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.chart.axis.ValueAxis getRangeAxis()