170-2-3

XYIntervalSeriesCollection c1 = new XYIntervalSeriesCollection(); XYIntervalSeriesCollection c2 = new XYIntervalSeriesCollection(); assertEquals(c1, c2); // add a series XYIntervalSeries s1 = new XYIntervalSeries("Series"); s1.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5); c1.addSeries(s1); assertFalse(c1.equals(c2)); XYIntervalSeries s2 = new XYIntervalSeries("Series"); s2.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5); c2.addSeries(s2); assertTrue(c1.equals(c2)); // add an empty series c1.addSeries(new XYIntervalSeries("Empty Series")); assertFalse(c1.equals(c2)); c2.addSeries(new XYIntervalSeries("Empty Series")); assertTrue(c1.equals(c2));
XIntervalSeriesCollection c1 = new XIntervalSeriesCollection(); XIntervalSeriesCollection c2 = new XIntervalSeriesCollection(); assertEquals(c1, c2); // add a series XIntervalSeries s1 = new XIntervalSeries("Series"); s1.add(1.0, 1.1, 1.2, 1.3); c1.addSeries(s1); assertFalse(c1.equals(c2)); XIntervalSeries s2 = new XIntervalSeries("Series"); s2.add(1.0, 1.1, 1.2, 1.3); c2.addSeries(s2); assertTrue(c1.equals(c2)); // add an empty series c1.addSeries(new XIntervalSeries("Empty Series")); assertFalse(c1.equals(c2)); c2.addSeries(new XIntervalSeries("Empty Series")); assertTrue(c1.equals(c2));

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

1

    XYIntervalSeriesCollection c1 = new XYIntervalSeriesCollection();↵

1

    XIntervalSeriesCollection c1 = new XIntervalSeriesCollection();↵

2

            XYIntervalSeriesCollection c2 = new XYIntervalSeriesCollection();↵

2

            XIntervalSeriesCollection c2 = new XIntervalSeriesCollection();↵

3

            assertEquals(c1, c2);↵

3

            assertEquals(c1, c2);↵

4

            // add a series↵

4

            // add a series↵

5

            XYIntervalSeries s1 = new XYIntervalSeries("Series");↵

5

            XIntervalSeries s1 = new XIntervalSeries("Series");↵

6

            s1.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);↵

6

            s1.add(1.0, 1.1, 1.2, 1.3);↵

7

            c1.addSeries(s1);↵

7

            c1.addSeries(s1);↵

8

            assertFalse(c1.equals(c2));↵

8

            assertFalse(c1.equals(c2));↵

9

            XYIntervalSeries s2 = new XYIntervalSeries("Series");↵

9

            XIntervalSeries s2 = new XIntervalSeries("Series");↵

10

            s2.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);↵

10

            s2.add(1.0, 1.1, 1.2, 1.3);↵

11

            c2.addSeries(s2);↵

11

            c2.addSeries(s2);↵

12

            assertTrue(c1.equals(c2));↵

12

            assertTrue(c1.equals(c2));↵

13

            // add an empty series↵

13

            // add an empty series↵

14

            c1.addSeries(new XYIntervalSeries("Empty Series"));↵

14

            c1.addSeries(new XIntervalSeries("Empty Series"));↵

15

            assertFalse(c1.equals(c2));↵

15

            assertFalse(c1.equals(c2));↵

16

            c2.addSeries(new XYIntervalSeries("Empty Series"));↵

16

            c2.addSeries(new XIntervalSeries("Empty Series"));↵

17

            assertTrue(c1.equals(c2));

17

            assertTrue(c1.equals(c2));

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

1. {Non-refactorable}

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

       XYIntervalSeriesCollection c1 = new XYIntervalSeriesCollection();

   1

       XIntervalSeriesCollection c1 = new XIntervalSeriesCollection();

   2

       XYIntervalSeriesCollection c2 = new XYIntervalSeriesCollection();

   2

       XIntervalSeriesCollection c2 = new XIntervalSeriesCollection();

   3

       assertEquals(c1, c2);

   3

       assertEquals(c1, c2);

   4

       XYIntervalSeries s1 = new XYIntervalSeries("Series");

   4 | XYIntervalSeries s1 = new XYIntervalSeries("Series");
   4 | XIntervalSeries s1 = new XIntervalSeries("Series");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH

   4

       XIntervalSeries s1 = new XIntervalSeries("Series");

   5

       s1.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);

   5 | s1.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);
   5 | s1.add(1.0, 1.1, 1.2, 1.3);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH
   s1.add(1.0,1.1,1.2,1.3,1.4,1.5) | s1.add(1.0,1.1,1.2,1.3) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression s1.add(1.0,1.1,1.2,1.3,1.4,1.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression s1.add(1.0,1.1,1.2,1.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression s1.add(1.0,1.1,1.2,1.3,1.4,1.5) is a void method call, and thus it cannot be parameterized
   Expression s1.add(1.0,1.1,1.2,1.3) is a void method call, and thus it cannot be parameterized

   5

       s1.add(1.0, 1.1, 1.2, 1.3);

   6

       c1.addSeries(s1);

   6 | c1.addSeries(s1);
   6 | c1.addSeries(s1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH

   6

       c1.addSeries(s1);

   7

       assertFalse(c1.equals(c2));

   7

       assertFalse(c1.equals(c2));

   8

       XYIntervalSeries s2 = new XYIntervalSeries("Series");

   8 | XYIntervalSeries s2 = new XYIntervalSeries("Series");
   8 | XIntervalSeries s2 = new XIntervalSeries("Series");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH

   8

       XIntervalSeries s2 = new XIntervalSeries("Series");

   9

       s2.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);

   9 | s2.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);
   9 | s2.add(1.0, 1.1, 1.2, 1.3);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH
   s2.add(1.0,1.1,1.2,1.3,1.4,1.5) | s2.add(1.0,1.1,1.2,1.3) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression s2.add(1.0,1.1,1.2,1.3,1.4,1.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression s2.add(1.0,1.1,1.2,1.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression s2.add(1.0,1.1,1.2,1.3,1.4,1.5) is a void method call, and thus it cannot be parameterized
   Expression s2.add(1.0,1.1,1.2,1.3) is a void method call, and thus it cannot be parameterized

   9

       s2.add(1.0, 1.1, 1.2, 1.3);

   10

       c2.addSeries(s2);

   10 | c2.addSeries(s2);
   10 | c2.addSeries(s2);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH

   10

       c2.addSeries(s2);

   11

       assertTrue(c1.equals(c2));

   11

       assertTrue(c1.equals(c2));

   12

       c1.addSeries(new XYIntervalSeries("Empty Series"));

   12 | c1.addSeries(new XYIntervalSeries("Empty Series"));
   12 | c1.addSeries(new XIntervalSeries("Empty Series"));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH

   12

       c1.addSeries(new XIntervalSeries("Empty Series"));

   13

       assertFalse(c1.equals(c2));

   13

       assertFalse(c1.equals(c2));

   14

       c2.addSeries(new XYIntervalSeries("Empty Series"));

   14 | c2.addSeries(new XYIntervalSeries("Empty Series"));
   14 | c2.addSeries(new XIntervalSeries("Empty Series"));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.XYIntervalSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH

   14

       c2.addSeries(new XIntervalSeries("Empty Series"));

   15

       assertTrue(c1.equals(c2));

   15

       assertTrue(c1.equals(c2));

   Precondition Violations (8)
   Row | Violation
   --- | ---
   1 | Expression s1.add(1.0,1.1,1.2,1.3,1.4,1.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression s1.add(1.0,1.1,1.2,1.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression s1.add(1.0,1.1,1.2,1.3,1.4,1.5) is a void method call, and thus it cannot be parameterized
   4 | Expression s1.add(1.0,1.1,1.2,1.3) is a void method call, and thus it cannot be parameterized
   5 | Expression s2.add(1.0,1.1,1.2,1.3,1.4,1.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Expression s2.add(1.0,1.1,1.2,1.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression s2.add(1.0,1.1,1.2,1.3,1.4,1.5) is a void method call, and thus it cannot be parameterized
   8 | Expression s2.add(1.0,1.1,1.2,1.3) is a void method call, and thus it cannot be parameterized