149-1-3

VectorSeries s1 = new VectorSeries("s1"); VectorSeries s2 = new VectorSeries("s1"); assertTrue(s1.equals(s2)); // seriesKey s1 = new VectorSeries("s2"); assertFalse(s1.equals(s2)); s2 = new VectorSeries("s2"); assertTrue(s1.equals(s2)); // autoSort s1 = new VectorSeries("s2", true, true); assertFalse(s1.equals(s2)); s2 = new VectorSeries("s2", true, true); assertTrue(s1.equals(s2)); // allowDuplicateValues s1 = new VectorSeries("s2", false, false); assertFalse(s1.equals(s2)); s2 = new VectorSeries("s2", false, false); assertTrue(s1.equals(s2)); // add a value s1.add(1.0, 0.5, 1.5, 2.0); assertFalse(s1.equals(s2)); s2.add(1.0, 0.5, 1.5, 2.0); assertTrue(s2.equals(s1)); // add another value s1.add(2.0, 0.5, 1.5, 2.0); assertFalse(s1.equals(s2)); s2.add(2.0, 0.5, 1.5, 2.0); assertTrue(s2.equals(s1)); // remove a value s1.remove(new XYCoordinate(1.0, 0.5)); assertFalse(s1.equals(s2)); s2.remove(new XYCoordinate(1.0, 0.5)); assertTrue(s2.equals(s1));
YIntervalSeries s1 = new YIntervalSeries("s1"); YIntervalSeries s2 = new YIntervalSeries("s1"); assertTrue(s1.equals(s2)); // seriesKey s1 = new YIntervalSeries("s2"); assertFalse(s1.equals(s2)); s2 = new YIntervalSeries("s2"); assertTrue(s1.equals(s2)); // autoSort s1 = new YIntervalSeries("s2", false, true); assertFalse(s1.equals(s2)); s2 = new YIntervalSeries("s2", false, true); assertTrue(s1.equals(s2)); // allowDuplicateValues s1 = new YIntervalSeries("s2", false, false); assertFalse(s1.equals(s2)); s2 = new YIntervalSeries("s2", false, false); assertTrue(s1.equals(s2)); // add a value s1.add(1.0, 0.5, 1.5, 2.0); assertFalse(s1.equals(s2)); s2.add(1.0, 0.5, 1.5, 2.0); assertTrue(s2.equals(s1)); // add another value s1.add(2.0, 0.5, 1.5, 2.0); assertFalse(s1.equals(s2)); s2.add(2.0, 0.5, 1.5, 2.0); assertTrue(s2.equals(s1)); // remove a value s1.remove(new Double(1.0)); assertFalse(s1.equals(s2)); s2.remove(new Double(1.0)); assertTrue(s2.equals(s1));

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

1

    VectorSeries s1 = new VectorSeries("s1");↵

1

    YIntervalSeries s1 = new YIntervalSeries("s1");↵

2

            VectorSeries s2 = new VectorSeries("s1");↵

2

            YIntervalSeries s2 = new YIntervalSeries("s1");↵

3

            assertTrue(s1.equals(s2));↵

3

            assertTrue(s1.equals(s2));↵

4

            ↵

4

            ↵

5

            // seriesKey↵

5

            // seriesKey↵

6

            s1 = new VectorSeries("s2");↵

6

            s1 = new YIntervalSeries("s2");↵

7

            assertFalse(s1.equals(s2));↵

7

            assertFalse(s1.equals(s2));↵

8

            s2 = new VectorSeries("s2");↵

8

            s2 = new YIntervalSeries("s2");↵

9

            assertTrue(s1.equals(s2));↵

9

            assertTrue(s1.equals(s2));↵

10

            ↵

10

            ↵

11

            // autoSort↵

11

            // autoSort↵

12

            s1 = new VectorSeries("s2", true, true);↵

12

            s1 = new YIntervalSeries("s2", false, true);↵

13

            assertFalse(s1.equals(s2));↵

13

            assertFalse(s1.equals(s2));↵

14

            s2 = new VectorSeries("s2", true, true);↵

14

            s2 = new YIntervalSeries("s2", false, true);↵

15

            assertTrue(s1.equals(s2));↵

15

            assertTrue(s1.equals(s2));↵

16

            ↵

16

            ↵

17

            // allowDuplicateValues↵

17

            // allowDuplicateValues↵

18

            s1 = new VectorSeries("s2", false, false);↵

18

            s1 = new YIntervalSeries("s2", false, false);↵

19

            assertFalse(s1.equals(s2));↵

19

            assertFalse(s1.equals(s2));↵

20

            s2 = new VectorSeries("s2", false, false);↵

20

            s2 = new YIntervalSeries("s2", false, false);↵

21

            assertTrue(s1.equals(s2));↵

21

            assertTrue(s1.equals(s2));↵

22

            ↵

22

            ↵

23

            // add a value↵

23

            // add a value↵

24

            s1.add(1.0, 0.5, 1.5, 2.0);↵

24

            s1.add(1.0, 0.5, 1.5, 2.0);↵

25

            assertFalse(s1.equals(s2));↵

25

            assertFalse(s1.equals(s2));↵

26

            s2.add(1.0, 0.5, 1.5, 2.0);↵

26

            s2.add(1.0, 0.5, 1.5, 2.0);↵

27

            assertTrue(s2.equals(s1));↵

27

            assertTrue(s2.equals(s1));↵

28

            // add another value↵

28

            // add another value↵

29

            s1.add(2.0, 0.5, 1.5, 2.0);↵

29

            s1.add(2.0, 0.5, 1.5, 2.0);↵

30

            assertFalse(s1.equals(s2));↵

30

            assertFalse(s1.equals(s2));↵

31

            s2.add(2.0, 0.5, 1.5, 2.0);↵

31

            s2.add(2.0, 0.5, 1.5, 2.0);↵

32

            assertTrue(s2.equals(s1));↵

32

            assertTrue(s2.equals(s1));↵

33

            // remove a value↵

33

            // remove a value↵

34

            s1.remove(new XYCoordinate(1.0, 0.5));↵

34

            s1.remove(new Double(1.0));↵

35

            assertFalse(s1.equals(s2));↵

35

            assertFalse(s1.equals(s2));↵

36

            s2.remove(new XYCoordinate(1.0, 0.5));↵

36

            s2.remove(new Double(1.0));↵

37

            assertTrue(s2.equals(s1));

37

            assertTrue(s2.equals(s1));

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 25
   Number of unmapped statements in the first code fragment | 2
   Number of unmapped statements in the second code fragment | 2
   Time elapsed for statement mapping (ms) | 0.0
   Clone type | Type 2

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

   1

       VectorSeries s1 = new VectorSeries("s1");

   1 | VectorSeries s1 = new VectorSeries("s1");
   1 | YIntervalSeries s1 = new YIntervalSeries("s1");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   1

       YIntervalSeries s1 = new YIntervalSeries("s1");

   2

       VectorSeries s2 = new VectorSeries("s1");

   2 | VectorSeries s2 = new VectorSeries("s1");
   2 | YIntervalSeries s2 = new YIntervalSeries("s1");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   2

       YIntervalSeries s2 = new YIntervalSeries("s1");

   3

       assertTrue(s1.equals(s2));

   3 | assertTrue(s1.equals(s2));
   3 | assertTrue(s1.equals(s2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   3

       assertTrue(s1.equals(s2));

   4

       s1 = new VectorSeries("s2");

   4 | s1 = new VectorSeries("s2");
   4 | s1 = new YIntervalSeries("s2");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   4

       s1 = new YIntervalSeries("s2");

   5

       assertFalse(s1.equals(s2));

   5 | assertFalse(s1.equals(s2));
   5 | assertFalse(s1.equals(s2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   5

       assertFalse(s1.equals(s2));

   6

       s2 = new VectorSeries("s2");

   6 | s2 = new VectorSeries("s2");
   6 | s2 = new YIntervalSeries("s2");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   6

       s2 = new YIntervalSeries("s2");

   7

       assertTrue(s1.equals(s2));

   7 | assertTrue(s1.equals(s2));
   7 | assertTrue(s1.equals(s2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   7

       assertTrue(s1.equals(s2));

   8

       s1 = new VectorSeries("s2", true, true);

   8 | s1 = new VectorSeries("s2", true, true);
   8 | s1 = new YIntervalSeries("s2", false, true);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   true | false | LITERAL_VALUE_MISMATCH

   8

       s1 = new YIntervalSeries("s2", false, true);

   9

       assertFalse(s1.equals(s2));

   9 | assertFalse(s1.equals(s2));
   9 | assertFalse(s1.equals(s2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   9

       assertFalse(s1.equals(s2));

   10

       s2 = new VectorSeries("s2", true, true);

   10 | s2 = new VectorSeries("s2", true, true);
   10 | s2 = new YIntervalSeries("s2", false, true);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   true | false | LITERAL_VALUE_MISMATCH

   10

       s2 = new YIntervalSeries("s2", false, true);

   11

       assertTrue(s1.equals(s2));

   11 | assertTrue(s1.equals(s2));
   11 | assertTrue(s1.equals(s2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   11

       assertTrue(s1.equals(s2));

   12

       s1 = new VectorSeries("s2", false, false);

   12 | s1 = new VectorSeries("s2", false, false);
   12 | s1 = new YIntervalSeries("s2", false, false);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   12

       s1 = new YIntervalSeries("s2", false, false);

   13

       assertFalse(s1.equals(s2));

   13 | assertFalse(s1.equals(s2));
   13 | assertFalse(s1.equals(s2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   13

       assertFalse(s1.equals(s2));

   14

       s2 = new VectorSeries("s2", false, false);

   14 | s2 = new VectorSeries("s2", false, false);
   14 | s2 = new YIntervalSeries("s2", false, false);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   14

       s2 = new YIntervalSeries("s2", false, false);

   15

       assertTrue(s1.equals(s2));

   15 | assertTrue(s1.equals(s2));
   15 | assertTrue(s1.equals(s2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   15

       assertTrue(s1.equals(s2));

   16

       s1.add(1.0, 0.5, 1.5, 2.0);

   16 | s1.add(1.0, 0.5, 1.5, 2.0);
   16 | s1.add(1.0, 0.5, 1.5, 2.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   Preondition Violations
   Expression s1 cannot be unified with expression s1 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(double, double, double, double)

   16

       s1.add(1.0, 0.5, 1.5, 2.0);

   17

       assertFalse(s1.equals(s2));

   17 | assertFalse(s1.equals(s2));
   17 | assertFalse(s1.equals(s2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   17

       assertFalse(s1.equals(s2));

   18

       s2.add(1.0, 0.5, 1.5, 2.0);

   18 | s2.add(1.0, 0.5, 1.5, 2.0);
   18 | s2.add(1.0, 0.5, 1.5, 2.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   Preondition Violations
   Expression s2 cannot be unified with expression s2 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(double, double, double, double)

   18

       s2.add(1.0, 0.5, 1.5, 2.0);

   19

       assertTrue(s2.equals(s1));

   19 | assertTrue(s2.equals(s1));
   19 | assertTrue(s2.equals(s1));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   19

       assertTrue(s2.equals(s1));

   20

       s1.add(2.0, 0.5, 1.5, 2.0);

   20 | s1.add(2.0, 0.5, 1.5, 2.0);
   20 | s1.add(2.0, 0.5, 1.5, 2.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   Preondition Violations
   Expression s1 cannot be unified with expression s1 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(double, double, double, double)

   20

       s1.add(2.0, 0.5, 1.5, 2.0);

   21

       assertFalse(s1.equals(s2));

   21 | assertFalse(s1.equals(s2));
   21 | assertFalse(s1.equals(s2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   21

       assertFalse(s1.equals(s2));

   22

       s2.add(2.0, 0.5, 1.5, 2.0);

   22 | s2.add(2.0, 0.5, 1.5, 2.0);
   22 | s2.add(2.0, 0.5, 1.5, 2.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   Preondition Violations
   Expression s2 cannot be unified with expression s2 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(double, double, double, double)

   22

       s2.add(2.0, 0.5, 1.5, 2.0);

   23

       assertTrue(s2.equals(s1));

   23 | assertTrue(s2.equals(s1));
   23 | assertTrue(s2.equals(s1));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   23

       assertTrue(s2.equals(s1));

   24

       s1.remove(new Double(1.0));

   24

       s1.remove(new XYCoordinate(1.0, 0.5));

   25

       assertFalse(s1.equals(s2));

   25 | assertFalse(s1.equals(s2));
   25 | assertFalse(s1.equals(s2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   25

       assertFalse(s1.equals(s2));

   26

       s2.remove(new Double(1.0));

   26

       s2.remove(new XYCoordinate(1.0, 0.5));

   27

       assertTrue(s2.equals(s1));

   27 | assertTrue(s2.equals(s1));
   27 | assertTrue(s2.equals(s1));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.VectorSeries | org.jfree.data.xy.YIntervalSeries | SUBCLASS_TYPE_MISMATCH

   27

       assertTrue(s2.equals(s1));

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Expression s1 cannot be unified with expression s1 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(double, double, double, double)
   2 | Expression s2 cannot be unified with expression s2 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(double, double, double, double)
   3 | Expression s1 cannot be unified with expression s1 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(double, double, double, double)
   4 | Expression s2 cannot be unified with expression s2 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(double, double, double, double)
   5 | Clone fragment #1 returns variables s1, s2 , while Clone fragment #2 returns variables s1, s2