290-1-2

VectorDataItem v1 = new VectorDataItem(1.0, 2.0, 3.0, 4.0); VectorDataItem v2 = new VectorDataItem(1.0, 2.0, 3.0, 4.0); assertTrue(v1.equals(v2)); assertTrue(v2.equals(v1)); v1 = new VectorDataItem(1.1, 2.0, 3.0, 4.0); assertFalse(v1.equals(v2)); v2 = new VectorDataItem(1.1, 2.0, 3.0, 4.0); assertTrue(v1.equals(v2)); v1 = new VectorDataItem(1.1, 2.2, 3.0, 4.0); assertFalse(v1.equals(v2)); v2 = new VectorDataItem(1.1, 2.2, 3.0, 4.0); assertTrue(v1.equals(v2)); v1 = new VectorDataItem(1.1, 2.2, 3.3, 4.0); assertFalse(v1.equals(v2)); v2 = new VectorDataItem(1.1, 2.2, 3.3, 4.0); assertTrue(v1.equals(v2)); v1 = new VectorDataItem(1.1, 2.2, 3.3, 4.4); assertFalse(v1.equals(v2)); v2 = new VectorDataItem(1.1, 2.2, 3.3, 4.4); assertTrue(v1.equals(v2));
XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0); XIntervalDataItem item2 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0); assertTrue(item1.equals(item2)); assertTrue(item2.equals(item1)); // x item1 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0); assertFalse(item1.equals(item2)); item2 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0); assertTrue(item1.equals(item2)); // xLow item1 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0); assertFalse(item1.equals(item2)); item2 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0); assertTrue(item1.equals(item2)); // xHigh item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0); assertFalse(item1.equals(item2)); item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0); assertTrue(item1.equals(item2)); // y item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4); assertFalse(item1.equals(item2)); item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4); assertTrue(item1.equals(item2));

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/VectorDataItemTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XIntervalDataItemTests.java
Method name: `void testEquals()` |  | Method name: `void testEquals()`
Number of AST nodes: 20 |  | Number of AST nodes: 20

1

    VectorDataItem v1 = new VectorDataItem(1.0, 2.0, 3.0, 4.0);↵

1

    XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);↵

2

            VectorDataItem v2 = new VectorDataItem(1.0, 2.0, 3.0, 4.0);↵

2

            XIntervalDataItem item2 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);↵

3

            assertTrue(v1.equals(v2));↵

3

            assertTrue(item1.equals(item2));↵

4

            assertTrue(v2.equals(v1));↵

4

            assertTrue(item2.equals(item1));↵

5

            v1 = new Vector↵

5

            // x↵

6

    DataItem(1.1, 2.0, 3.0, 4.0);↵

6

            item1 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);↵

7

            assertFalse(v1.equals(v2));↵

7

            assertFalse(item1.equals(item2));↵

8

            v2 = new VectorDataItem(1.1, 2.0, 3.0, 4.0);↵

8

            item2 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);↵

9

            assertTrue(v1.equals(v2));↵

9

            assertTrue(item1.equals(item2));↵

10

            ↵

10

            ↵

11

            v1 = new Vector↵

11

            // xLow↵

12

    DataItem(1.1, 2.2, 3.0, 4.0);↵

12

            item1 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);↵

13

            assertFalse(v1.equals(v2));↵

13

            assertFalse(item1.equals(item2));↵

14

            v2 = new VectorDataItem(1.1, 2.2, 3.0, 4.0);↵

14

            item2 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);↵

15

            assertTrue(v1.equals(v2));↵

15

            assertTrue(item1.equals(item2));↵

16

            v1 = new Vector↵

16

            // xHigh↵

17

    DataItem(1.1, 2.2, 3.3, 4.0);↵

17

            item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);↵

18

            assertFalse(v1.equals(v2));↵

18

            assertFalse(item1.equals(item2));↵

19

            v2 = new VectorDataItem(1.1, 2.2, 3.3, 4.0);↵

19

            item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);↵

20

            assertTrue(v1.equals(v2));↵

20

            assertTrue(item1.equals(item2));↵

21

        ↵

21

            // y↵

22

            v1 = new VectorDataItem(1.1, 2.2, 3.3, 4.4);↵

22

            item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);↵

23

            assertFalse(v1.equals(v2));↵

23

            assertFalse(item1.equals(item2));↵

24

            v2 = new VectorDataItem(1.1, 2.2, 3.3, 4.4);↵

24

            item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);↵

25

            assertTrue(v1.equals(v2));

25

            assertTrue(item1.equals(item2));

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

1. {Refactorable}

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

       VectorDataItem v1 = new VectorDataItem(1.0, 2.0, 3.0, 4.0);

   1 | VectorDataItem v1 = new VectorDataItem(1.0, 2.0, 3.0, 4.0);
   1 | XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   1

       XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);

   2

       VectorDataItem v2 = new VectorDataItem(1.0, 2.0, 3.0, 4.0);

   2 | VectorDataItem v2 = new VectorDataItem(1.0, 2.0, 3.0, 4.0);
   2 | XIntervalDataItem item2 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   2

       XIntervalDataItem item2 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);

   3

       assertTrue(v1.equals(v2));

   3 | assertTrue(v1.equals(v2));
   3 | assertTrue(item1.equals(item2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   3

       assertTrue(item1.equals(item2));

   4

       assertTrue(v2.equals(v1));

   4 | assertTrue(v2.equals(v1));
   4 | assertTrue(item2.equals(item1));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   4

       assertTrue(item2.equals(item1));

   5

       v1 = new VectorDataItem(1.1, 2.0, 3.0, 4.0);

   5 | v1 = new VectorDataItem(1.1, 2.0, 3.0, 4.0);
   5 | item1 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   5

       item1 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);

   6

       assertFalse(v1.equals(v2));

   6 | assertFalse(v1.equals(v2));
   6 | assertFalse(item1.equals(item2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   6

       assertFalse(item1.equals(item2));

   7

       v2 = new VectorDataItem(1.1, 2.0, 3.0, 4.0);

   7 | v2 = new VectorDataItem(1.1, 2.0, 3.0, 4.0);
   7 | item2 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   7

       item2 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);

   8

       assertTrue(v1.equals(v2));

   8 | assertTrue(v1.equals(v2));
   8 | assertTrue(item1.equals(item2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   8

       assertTrue(item1.equals(item2));

   9

       v1 = new VectorDataItem(1.1, 2.2, 3.0, 4.0);

   9 | v1 = new VectorDataItem(1.1, 2.2, 3.0, 4.0);
   9 | item1 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   9

       item1 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);

   10

       assertFalse(v1.equals(v2));

   10 | assertFalse(v1.equals(v2));
   10 | assertFalse(item1.equals(item2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   10

       assertFalse(item1.equals(item2));

   11

       v2 = new VectorDataItem(1.1, 2.2, 3.0, 4.0);

   11 | v2 = new VectorDataItem(1.1, 2.2, 3.0, 4.0);
   11 | item2 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   11

       item2 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);

   12

       assertTrue(v1.equals(v2));

   12 | assertTrue(v1.equals(v2));
   12 | assertTrue(item1.equals(item2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   12

       assertTrue(item1.equals(item2));

   13

       v1 = new VectorDataItem(1.1, 2.2, 3.3, 4.0);

   13 | v1 = new VectorDataItem(1.1, 2.2, 3.3, 4.0);
   13 | item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   13

       item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);

   14

       assertFalse(v1.equals(v2));

   14 | assertFalse(v1.equals(v2));
   14 | assertFalse(item1.equals(item2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   14

       assertFalse(item1.equals(item2));

   15

       v2 = new VectorDataItem(1.1, 2.2, 3.3, 4.0);

   15 | v2 = new VectorDataItem(1.1, 2.2, 3.3, 4.0);
   15 | item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   15

       item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);

   16

       assertTrue(v1.equals(v2));

   16 | assertTrue(v1.equals(v2));
   16 | assertTrue(item1.equals(item2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   16

       assertTrue(item1.equals(item2));

   17

       v1 = new VectorDataItem(1.1, 2.2, 3.3, 4.4);

   17 | v1 = new VectorDataItem(1.1, 2.2, 3.3, 4.4);
   17 | item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   17

       item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);

   18

       assertFalse(v1.equals(v2));

   18 | assertFalse(v1.equals(v2));
   18 | assertFalse(item1.equals(item2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   18

       assertFalse(item1.equals(item2));

   19

       v2 = new VectorDataItem(1.1, 2.2, 3.3, 4.4);

   19 | v2 = new VectorDataItem(1.1, 2.2, 3.3, 4.4);
   19 | item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   19

       item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);

   20

       assertTrue(v1.equals(v2));

   20 | assertTrue(v1.equals(v2));
   20 | assertTrue(item1.equals(item2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | item2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH
   v1 | item1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.VectorDataItem | org.jfree.data.xy.XIntervalDataItem | SUBCLASS_TYPE_MISMATCH

   20

       assertTrue(item1.equals(item2));

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