1495-1-2

LocalListener l = new LocalListener(); this.pieChart.addChangeListener(l); PiePlot plot = (PiePlot) this.pieChart.getPlot(); plot.setDataset(null); assertEquals(true, l.flag); assertNull(plot.getDataset());
LocalListener l = new LocalListener(); this.pieChart.addChangeListener(l); PiePlot plot = (PiePlot) this.pieChart.getPlot(); plot.setDataset(null); assertEquals(true, l.flag); assertNull(plot.getDataset());

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/junit/PieChart3DTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/chart/junit/PieChartTests.java
Method name: `void testReplaceDatasetOnPieChart()` |  | Method name: `void testReplaceDatasetOnPieChart()`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    LocalListener l = new LocalListener();↵

1

    LocalListener l = new LocalListener();↵

2

            this.pieChart.addChangeListener(l);↵

2

            this.pieChart.addChangeListener(l);↵

3

            PiePlot plot = (PiePlot) this.pieChart.getPlot();↵

3

            PiePlot plot = (PiePlot) this.pieChart.getPlot();↵

4

            plot.setDataset(null);↵

4

            plot.setDataset(null);↵

5

            assertEquals(true, l.flag);↵

5

            assertEquals(true, l.flag);↵

6

            assertNull(plot.getDataset());

6

            assertNull(plot.getDataset());

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 24

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 5
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 0.0
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       LocalListener l = new LocalListener();

   1

       LocalListener l = new LocalListener();

   2

       this.pieChart.addChangeListener(l);

   2 | this.pieChart.addChangeListener(l);
   2 | this.pieChart.addChangeListener(l);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.junit.PieChart3DTests.LocalListener | org.jfree.chart.junit.PieChartTests.LocalListener | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.junit.PieChart3DTests.LocalListener of variable l does not match with type org.jfree.chart.junit.PieChartTests.LocalListener of variable l
   - Make classes org.jfree.chart.junit.PieChart3DTests.LocalListener and org.jfree.chart.junit.PieChartTests.LocalListener extend a common superclass

   2

       this.pieChart.addChangeListener(l);

   3

       PiePlot plot = (PiePlot)this.pieChart.getPlot();

   3

       PiePlot plot = (PiePlot)this.pieChart.getPlot();

   4

       plot.setDataset(null);

   4

       plot.setDataset(null);

   5

       assertEquals(true, l.flag);

   5 | assertEquals(true, l.flag);
   5 | assertEquals(true, l.flag);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.junit.PieChart3DTests.LocalListener | org.jfree.chart.junit.PieChartTests.LocalListener | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.junit.PieChart3DTests.LocalListener of variable l does not match with type org.jfree.chart.junit.PieChartTests.LocalListener of variable l
   - Make classes org.jfree.chart.junit.PieChart3DTests.LocalListener and org.jfree.chart.junit.PieChartTests.LocalListener extend a common superclass

   5

       assertEquals(true, l.flag);

   6

       assertNull(plot.getDataset());

   6

       assertNull(plot.getDataset());

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Type org.jfree.chart.junit.PieChart3DTests.LocalListener of variable l does not match with type org.jfree.chart.junit.PieChartTests.LocalListener of variable l
   2 | Type org.jfree.chart.junit.PieChart3DTests.LocalListener of variable l does not match with type org.jfree.chart.junit.PieChartTests.LocalListener of variable l