1388-4-19

CategoryPlot plot = (CategoryPlot) this.chart.getPlot(); CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); renderer.setSeriesItemURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1);
CategoryPlot plot = (CategoryPlot) this.chart.getPlot(); CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); renderer.setSeriesItemURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1);

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

1

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

1

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

2

            CategoryItemRenderer renderer = plot.getRenderer();↵

2

            CategoryItemRenderer renderer = plot.getRenderer();↵

3

            StandardCategoryURLGenerator url1↵

3

            StandardCategoryURLGenerator url1↵

4

                    = new StandardCategoryURLGenerator();↵

4

                    = new StandardCategoryURLGenerator();↵

5

            renderer.setSeriesItemURLGenerator(0, url1);↵

5

            renderer.setSeriesItemURLGenerator(0, url1);↵

6

            CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0);↵

6

            CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0);↵

7

            assertTrue(url2 == url1);

7

            assertTrue(url2 == url1);

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

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

   1

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

   2

       CategoryItemRenderer renderer = plot.getRenderer();

   2

       CategoryItemRenderer renderer = plot.getRenderer();

   3

       StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator();

   3

       StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator();

   4

       renderer.setSeriesItemURLGenerator(0, url1);

   4

       renderer.setSeriesItemURLGenerator(0, url1);

   5

       CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0);

   5

       CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0);

   6

       assertTrue(url2 == url1);

   6

       assertTrue(url2 == url1);

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