187-4-5

DefaultCategoryDataset result = new DefaultCategoryDataset(); // row keys... String series1 = "Third"; String series2 = "Fourth"; // column keys... String type1 = "Type 1"; String type2 = "Type 2"; String type3 = "Type 3"; String type4 = "Type 4"; String type5 = "Type 5"; String type6 = "Type 6"; String type7 = "Type 7"; String type8 = "Type 8"; result.addValue(11.0, series1, type1); result.addValue(14.0, series1, type2); result.addValue(13.0, series1, type3); result.addValue(15.0, series1, type4); result.addValue(15.0, series1, type5); result.addValue(17.0, series1, type6); result.addValue(17.0, series1, type7); result.addValue(18.0, series1, type8); result.addValue(15.0, series2, type1); result.addValue(17.0, series2, type2); result.addValue(16.0, series2, type3); result.addValue(18.0, series2, type4); result.addValue(14.0, series2, type5); result.addValue(14.0, series2, type6); result.addValue(12.0, series2, type7); result.addValue(11.0, series2, type8); return result;
DefaultCategoryDataset result = new DefaultCategoryDataset(); // row keys... String series1 = "First"; String series2 = "Second"; // column keys... String type1 = "Type 1"; String type2 = "Type 2"; String type3 = "Type 3"; String type4 = "Type 4"; String type5 = "Type 5"; String type6 = "Type 6"; String type7 = "Type 7"; String type8 = "Type 8"; result.addValue(1.0, series1, type1); result.addValue(4.0, series1, type2); result.addValue(3.0, series1, type3); result.addValue(5.0, series1, type4); result.addValue(5.0, series1, type5); result.addValue(7.0, series1, type6); result.addValue(7.0, series1, type7); result.addValue(8.0, series1, type8); result.addValue(5.0, series2, type1); result.addValue(7.0, series2, type2); result.addValue(6.0, series2, type3); result.addValue(8.0, series2, type4); result.addValue(4.0, series2, type5); result.addValue(4.0, series2, type6); result.addValue(2.0, series2, type7); result.addValue(1.0, series2, type8); return result;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CombinedDomainCategoryPlotTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CombinedRangeCategoryPlotTests.java
Method name: `CategoryDataset createDataset2()` |  | Method name: `CategoryDataset createDataset1()`
Number of AST nodes: 28 |  | Number of AST nodes: 28

1

    DefaultCategoryDataset result = new DefaultCategoryDataset();↵

1

    DefaultCategoryDataset result = new DefaultCategoryDataset();↵

2

            // row keys...↵

2

            // row keys...↵

3

            String series1 = "Third";↵

3

            String series1 = "First";↵

4

            String series2 = "Fourth";↵

4

            String series2 = "Second";↵

5

            // column keys...↵

5

            // column keys...↵

6

            String type1 = "Type 1";↵

6

            String type1 = "Type 1";↵

7

            String type2 = "Type 2";↵

7

            String type2 = "Type 2";↵

8

            String type3 = "Type 3";↵

8

            String type3 = "Type 3";↵

9

            String type4 = "Type 4";↵

9

            String type4 = "Type 4";↵

10

            String type5 = "Type 5";↵

10

            String type5 = "Type 5";↵

11

            String type6 = "Type 6";↵

11

            String type6 = "Type 6";↵

12

            String type7 = "Type 7";↵

12

            String type7 = "Type 7";↵

13

            String type8 = "Type 8";↵

13

            String type8 = "Type 8";↵

14

            result.addValue(11.0, series1, type1);↵

14

            result.addValue(1.0, series1, type1);↵

15

            result.addValue(14.0, series1, type2);↵

15

            result.addValue(4.0, series1, type2);↵

16

            result.addValue(13.0, series1, type3);↵

16

            result.addValue(3.0, series1, type3);↵

17

            result.addValue(15.0, series1, type4);↵

17

            result.addValue(5.0, series1, type4);↵

18

            result.addValue(15.0, series1, type5);↵

18

            result.addValue(5.0, series1, type5);↵

19

            result.addValue(17.0, series1, type6);↵

19

            result.addValue(7.0, series1, type6);↵

20

            result.addValue(17.0, series1, type7);↵

20

            result.addValue(7.0, series1, type7);↵

21

            result.addValue(18.0, series1, type8);↵

21

            result.addValue(8.0, series1, type8);↵

22

            result.addValue(15.0, series2, type1);↵

22

            result.addValue(5.0, series2, type1);↵

23

            result.addValue(17.0, series2, type2);↵

23

            result.addValue(7.0, series2, type2);↵

24

            result.addValue(16.0, series2, type3);↵

24

            result.addValue(6.0, series2, type3);↵

25

            result.addValue(18.0, series2, type4);↵

25

            result.addValue(8.0, series2, type4);↵

26

            result.addValue(14.0, series2, type5);↵

26

            result.addValue(4.0, series2, type5);↵

27

            result.addValue(14.0, series2, type6);↵

27

            result.addValue(4.0, series2, type6);↵

28

            result.addValue(12.0, series2, type7);↵

28

            result.addValue(2.0, series2, type7);↵

29

            result.addValue(11.0, series2, type8);↵

29

            result.addValue(1.0, series2, type8);↵

30

            return result;

30

            return result;

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 | 410

1. {Refactorable}

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

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

   1

       DefaultCategoryDataset result = new DefaultCategoryDataset();

   1

       DefaultCategoryDataset result = new DefaultCategoryDataset();

   2

       String series1 = "Third";

   2 | String series1 = "Third";
   2 | String series1 = "First";

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "Third" | "First" | LITERAL_VALUE_MISMATCH

   2

       String series1 = "First";

   3

       String series2 = "Fourth";

   3 | String series2 = "Fourth";
   3 | String series2 = "Second";

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "Fourth" | "Second" | LITERAL_VALUE_MISMATCH

   3

       String series2 = "Second";

   4

       String type1 = "Type 1";

   4

       String type1 = "Type 1";

   5

       String type2 = "Type 2";

   5

       String type2 = "Type 2";

   6

       String type3 = "Type 3";

   6

       String type3 = "Type 3";

   7

       String type4 = "Type 4";

   7

       String type4 = "Type 4";

   8

       String type5 = "Type 5";

   8

       String type5 = "Type 5";

   9

       String type6 = "Type 6";

   9

       String type6 = "Type 6";

   10

       String type7 = "Type 7";

   10

       String type7 = "Type 7";

   11

       String type8 = "Type 8";

   11

       String type8 = "Type 8";

   12

       result.addValue(11.0, series1, type1);

   12 | result.addValue(11.0, series1, type1);
   12 | result.addValue(1.0, series1, type1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   11.0 | 1.0 | LITERAL_VALUE_MISMATCH

   12

       result.addValue(1.0, series1, type1);

   13

       result.addValue(14.0, series1, type2);

   13 | result.addValue(14.0, series1, type2);
   13 | result.addValue(4.0, series1, type2);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   14.0 | 4.0 | LITERAL_VALUE_MISMATCH

   13

       result.addValue(4.0, series1, type2);

   14

       result.addValue(13.0, series1, type3);

   14 | result.addValue(13.0, series1, type3);
   14 | result.addValue(3.0, series1, type3);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   13.0 | 3.0 | LITERAL_VALUE_MISMATCH

   14

       result.addValue(3.0, series1, type3);

   15

       result.addValue(15.0, series1, type4);

   15 | result.addValue(15.0, series1, type4);
   15 | result.addValue(5.0, series1, type4);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   15.0 | 5.0 | LITERAL_VALUE_MISMATCH

   15

       result.addValue(5.0, series1, type4);

   16

       result.addValue(15.0, series1, type5);

   16 | result.addValue(15.0, series1, type5);
   16 | result.addValue(5.0, series1, type5);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   15.0 | 5.0 | LITERAL_VALUE_MISMATCH

   16

       result.addValue(5.0, series1, type5);

   17

       result.addValue(17.0, series1, type6);

   17 | result.addValue(17.0, series1, type6);
   17 | result.addValue(7.0, series1, type6);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   17.0 | 7.0 | LITERAL_VALUE_MISMATCH

   17

       result.addValue(7.0, series1, type6);

   18

       result.addValue(17.0, series1, type7);

   18 | result.addValue(17.0, series1, type7);
   18 | result.addValue(7.0, series1, type7);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   17.0 | 7.0 | LITERAL_VALUE_MISMATCH

   18

       result.addValue(7.0, series1, type7);

   19

       result.addValue(18.0, series1, type8);

   19 | result.addValue(18.0, series1, type8);
   19 | result.addValue(8.0, series1, type8);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   18.0 | 8.0 | LITERAL_VALUE_MISMATCH

   19

       result.addValue(8.0, series1, type8);

   20

       result.addValue(15.0, series2, type1);

   20 | result.addValue(15.0, series2, type1);
   20 | result.addValue(5.0, series2, type1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   15.0 | 5.0 | LITERAL_VALUE_MISMATCH

   20

       result.addValue(5.0, series2, type1);

   21

       result.addValue(17.0, series2, type2);

   21 | result.addValue(17.0, series2, type2);
   21 | result.addValue(7.0, series2, type2);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   17.0 | 7.0 | LITERAL_VALUE_MISMATCH

   21

       result.addValue(7.0, series2, type2);

   22

       result.addValue(16.0, series2, type3);

   22 | result.addValue(16.0, series2, type3);
   22 | result.addValue(6.0, series2, type3);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   16.0 | 6.0 | LITERAL_VALUE_MISMATCH

   22

       result.addValue(6.0, series2, type3);

   23

       result.addValue(18.0, series2, type4);

   23 | result.addValue(18.0, series2, type4);
   23 | result.addValue(8.0, series2, type4);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   18.0 | 8.0 | LITERAL_VALUE_MISMATCH

   23

       result.addValue(8.0, series2, type4);

   24

       result.addValue(14.0, series2, type5);

   24 | result.addValue(14.0, series2, type5);
   24 | result.addValue(4.0, series2, type5);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   14.0 | 4.0 | LITERAL_VALUE_MISMATCH

   24

       result.addValue(4.0, series2, type5);

   25

       result.addValue(14.0, series2, type6);

   25 | result.addValue(14.0, series2, type6);
   25 | result.addValue(4.0, series2, type6);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   14.0 | 4.0 | LITERAL_VALUE_MISMATCH

   25

       result.addValue(4.0, series2, type6);

   26

       result.addValue(12.0, series2, type7);

   26 | result.addValue(12.0, series2, type7);
   26 | result.addValue(2.0, series2, type7);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   12.0 | 2.0 | LITERAL_VALUE_MISMATCH

   26

       result.addValue(2.0, series2, type7);

   27

       result.addValue(11.0, series2, type8);

   27 | result.addValue(11.0, series2, type8);
   27 | result.addValue(1.0, series2, type8);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   11.0 | 1.0 | LITERAL_VALUE_MISMATCH

   27

       result.addValue(1.0, series2, type8);

   28

       return result;

   28

       return result;

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