282-2-3

if (entities != null && hotspot != null) { String tip = null; XYToolTipGenerator generator = getToolTipGenerator( series, item ); if (generator != null) { tip = generator.generateToolTip(dataset, series, item); } String url = null; if (getURLGenerator() != null) { url = getURLGenerator().generateURL(dataset, series, item); } XYItemEntity entity = new XYItemEntity(hotspot, dataset, series, item, tip, url); entities.add(entity); }
if (entities != null) { String tip = null; XYToolTipGenerator generator = getToolTipGenerator(series, item); if (generator != null) { tip = generator.generateToolTip(dataset, series, item); } String url = null; if (getURLGenerator() != null) { url = getURLGenerator().generateURL(dataset, series, item); } XYItemEntity entity = new XYItemEntity(entityArea, dataset, series, item, tip, url); entities.add(entity); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYAreaRenderer2.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/HighLowRenderer.java
Method name: `void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)` |  | Method name: `void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)`
Number of AST nodes: 10 |  | Number of AST nodes: 10

1

    if (entities != null && hotspot != null) {↵

1

    if (entities != null) {↵

2

                    String tip = null;↵

2

                String tip = null;↵

3

                    XYToolTipGenerator generator = getToolTipGenerator(↵

3

                XYToolTipGenerator generator = getToolTipGenerator(↵

4

                        series, item↵

5

                    );↵

6

        ↵

4

    series, item);↵

7

                if (generator != null) {↵

5

                if (generator != null) {↵

8

                        tip = generator.generateToolTip(dataset, series, item);↵

6

                    tip = generator.generateToolTip(dataset, series, item);↵

9

                    }↵

7

                }↵

10

                    String url = null;↵

8

                String url = null;↵

11

                    if (getURLGenerator() != null) {↵

9

                if (getURLGenerator() != null) {↵

12

                        url = getURLGenerator().generateURL(dataset, series, item);↵

10

                    url = getURLGenerator().generateURL(dataset, series, item);↵

13

                    }↵

11

                }↵

14

                    XYItemEntity entity = new XYItemEntity(hotspot, dataset, ↵

12

                XYItemEntity entity = new XYItemEntity(entityArea, dataset,↵

15

                            series, item, tip, url);↵

13

                        series, item, tip, url);↵

16

                    entities.add(entity);↵

14

                entities.add(entity);↵

17

                }

15

            }

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.3
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 23

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 7
   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) | 1.5
   Clone type | Type 1

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

   60

       String tip = null;

   67

       String tip = null;

   61

       XYToolTipGenerator generator = getToolTipGenerator(series, item);

   68

       XYToolTipGenerator generator = getToolTipGenerator(series, item);

   62

       if (generator != null)

   69

       if (generator != null)

   63

       tip = generator.generateToolTip(dataset, series, item);

   70

       tip = generator.generateToolTip(dataset, series, item);

   64

       String url = null;

   71

       String url = null;

   65

       if (getURLGenerator() != null)

   72

       if (getURLGenerator() != null)

   66

       url = getURLGenerator().generateURL(dataset, series, item);

   73

       url = getURLGenerator().generateURL(dataset, series, item);

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Clone fragment #1 returns variables tip, url , while Clone fragment #2 returns variables tip, url