413-1-2

DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("One", new Double(43.2)); dataset.setValue("Two", new Double(10.0)); dataset.setValue("Three", new Double(27.5)); dataset.setValue("Four", new Double(17.5)); dataset.setValue("Five", new Double(11.0)); dataset.setValue("Six", new Double(19.4)); return dataset;
DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("One", new Double(43.2)); dataset.setValue("Two", new Double(10.0)); dataset.setValue("Three", new Double(27.5)); dataset.setValue("Four", new Double(17.5)); dataset.setValue("Five", new Double(11.0)); dataset.setValue("Six", new Double(19.4)); return dataset;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/demo/PieChartDemo1.java |  | File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/demo/SWTPieChartDemo1.java
Method name: `PieDataset createDataset()` |  | Method name: `PieDataset createDataset()`
Number of AST nodes: 8 |  | Number of AST nodes: 8

1

    DefaultPieDataset dataset = new DefaultPieDataset();
    ↵

1

    DefaultPieDataset dataset = new DefaultPieDataset();↵

2

            dataset.setValue("One", new Double(43.2));
    ↵

2

            dataset.setValue("One", new Double(43.2));↵

3

            dataset.setValue("Two", new Double(10.0));
    ↵

3

            dataset.setValue("Two", new Double(10.0));↵

4

            dataset.setValue("Three", new Double(27.5));
    ↵

4

            dataset.setValue("Three", new Double(27.5));↵

5

            dataset.setValue("Four", new Double(17.5));
    ↵

5

            dataset.setValue("Four", new Double(17.5));↵

6

            dataset.setValue("Five", new Double(11.0));
    ↵

6

            dataset.setValue("Five", new Double(11.0));↵

7

            dataset.setValue("Six", new Double(19.4));
    ↵

7

            dataset.setValue("Six", new Double(19.4));↵

8

            return dataset;

8

            return dataset;

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
Number of node comparisons | 50

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 8
   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

       DefaultPieDataset dataset = new DefaultPieDataset();

   1

       DefaultPieDataset dataset = new DefaultPieDataset();

   2

       dataset.setValue("One", new Double(43.2));

   2

       dataset.setValue("One", new Double(43.2));

   3

       dataset.setValue("Two", new Double(10.0));

   3

       dataset.setValue("Two", new Double(10.0));

   4

       dataset.setValue("Three", new Double(27.5));

   4

       dataset.setValue("Three", new Double(27.5));

   5

       dataset.setValue("Four", new Double(17.5));

   5

       dataset.setValue("Four", new Double(17.5));

   6

       dataset.setValue("Five", new Double(11.0));

   6

       dataset.setValue("Five", new Double(11.0));

   7

       dataset.setValue("Six", new Double(19.4));

   7

       dataset.setValue("Six", new Double(19.4));

   8

       return dataset;

   8

       return dataset;

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