1388-13-23

XYPlot plot = (XYPlot) this.chart.getPlot(); XYItemRenderer renderer = plot.getRenderer(); StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator(); renderer.setSeriesToolTipGenerator(0, tt); XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0); assertTrue(tt2 == tt);
XYPlot plot = (XYPlot) this.chart.getPlot(); XYItemRenderer renderer = plot.getRenderer(); StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator(); renderer.setSeriesToolTipGenerator(0, tt); XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0); assertTrue(tt2 == tt);

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

1

    XYPlot plot = (XYPlot) this.chart.getPlot();↵

1

    XYPlot plot = (XYPlot) this.chart.getPlot();↵

2

            XYItemRenderer renderer = plot.getRenderer();↵

2

            XYItemRenderer renderer = plot.getRenderer();↵

3

            StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();↵

3

            StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();↵

4

            renderer.setSeriesToolTipGenerator(0, tt);↵

4

            renderer.setSeriesToolTipGenerator(0, tt);↵

5

            XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);↵

5

            XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);↵

6

            assertTrue(tt2 == tt);

6

            assertTrue(tt2 == tt);

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
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 | 26

1. {Refactorable}

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

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

   1

       XYPlot plot = (XYPlot)this.chart.getPlot();

   1

       XYPlot plot = (XYPlot)this.chart.getPlot();

   2

       XYItemRenderer renderer = plot.getRenderer();

   2

       XYItemRenderer renderer = plot.getRenderer();

   3

       StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();

   3

       StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();

   4

       renderer.setSeriesToolTipGenerator(0, tt);

   4

       renderer.setSeriesToolTipGenerator(0, tt);

   5

       XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);

   5

       XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);

   6

       assertTrue(tt2 == tt);

   6

       assertTrue(tt2 == tt);

   Precondition Violations (0)
   Row | Violation
   --- | ---