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());
CombinedRangeCategoryPlot 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());
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/CombinedRangeCategoryPlotTests.java
Method name: void testNotification() Method name: void testNotification()
Number of AST nodes: 12 Number of AST nodes: 12
1
CombinedDomainCategoryPlot plot = createPlot();
1
CombinedRangeCategoryPlot 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
        CategoryPlot subplot1 = (CategoryPlot) 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
    CombinedRangeCategoryPlot plot = createPlot();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedDomainCategoryPlotorg.jfree.chart.plot.CombinedRangeCategoryPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CombinedDomainCategoryPlotorg.jfree.chart.plot.CombinedRangeCategoryPlotSUBCLASS_TYPE_MISMATCH
    1
    CombinedRangeCategoryPlot 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.CombinedRangeCategoryPlotSUBCLASS_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
    CategoryPlot subplot1 = (CategoryPlot)plot.getSubplots().get(0);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CombinedDomainCategoryPlotorg.jfree.chart.plot.CombinedRangeCategoryPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.CategoryPlot does not declare member(s) public List#RAW getSubplots()
    4
    CategoryPlot subplot1 = (CategoryPlot)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
    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 (1)
    Row Violation
    1Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.CategoryPlot does not declare member(s) public List#RAW getSubplots()