149-2-3

XIntervalSeries s1 = new XIntervalSeries("s1"); XIntervalSeries s2 = new XIntervalSeries("s1"); assertTrue(s1.equals(s2)); // seriesKey s1 = new XIntervalSeries("s2"); assertFalse(s1.equals(s2)); s2 = new XIntervalSeries("s2"); assertTrue(s1.equals(s2)); // autoSort s1 = new XIntervalSeries("s2", false, true); assertFalse(s1.equals(s2)); s2 = new XIntervalSeries("s2", false, true); assertTrue(s1.equals(s2)); // allowDuplicateValues s1 = new XIntervalSeries("s2", false, false); assertFalse(s1.equals(s2)); s2 = new XIntervalSeries("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));
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/XIntervalSeriesTests.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

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

1

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

2

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

2

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

3

            assertTrue(s1.equals(s2));↵

3

            assertTrue(s1.equals(s2));↵

4

            ↵

4

            // seriesKey↵

5

            // seriesKey↵

5

            s1 = new XIntervalSeries("s2");↵

6

            s1 = new YIntervalSeries("s2");↵

6

            assertFalse(s1.equals(s2));↵

7

            assertFalse(s1.equals(s2));↵

7

            s2 = new XIntervalSeries("s2");↵

8

            s2 = new YIntervalSeries("s2");↵

8

            assertTrue(s1.equals(s2));↵

9

            assertTrue(s1.equals(s2));↵

10

            ↵

9

            // autoSort↵

11

            // autoSort↵

10

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

12

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

11

            assertFalse(s1.equals(s2));↵

13

            assertFalse(s1.equals(s2));↵

12

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

14

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

13

            assertTrue(s1.equals(s2));↵

15

            assertTrue(s1.equals(s2));↵

16

            ↵

14

            // allowDuplicateValues↵

17

            // allowDuplicateValues↵

15

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

18

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

16

            assertFalse(s1.equals(s2));↵

19

            assertFalse(s1.equals(s2));↵

17

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

20

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

18

            assertTrue(s1.equals(s2));↵

21

            assertTrue(s1.equals(s2));↵

22

            ↵

19

            // add a value↵

23

            // add a value↵

20

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

24

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

21

            assertFalse(s1.equals(s2));↵

25

            assertFalse(s1.equals(s2));↵

22

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

26

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

23

            assertTrue(s2.equals(s1));↵

27

            assertTrue(s2.equals(s1));↵

24

            // add another value↵

28

            // add another value↵

25

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

29

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

26

            assertFalse(s1.equals(s2));↵

30

            assertFalse(s1.equals(s2));↵

27

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

31

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

28

            assertTrue(s2.equals(s1));↵

32

            assertTrue(s2.equals(s1));↵

29

            // remove a value↵

33

            // remove a value↵

30

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

34

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

31

            assertFalse(s1.equals(s2));↵

35

            assertFalse(s1.equals(s2));↵

32

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

36

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

33

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

1. {Refactorable}

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

       XIntervalSeries s1 = new XIntervalSeries("s1");

   1

       YIntervalSeries s1 = new YIntervalSeries("s1");

   2

       XIntervalSeries s2 = new XIntervalSeries("s1");

   2

       YIntervalSeries s2 = new YIntervalSeries("s1");

   3

       assertTrue(s1.equals(s2));

   3

       assertTrue(s1.equals(s2));

   4

       s1 = new XIntervalSeries("s2");

   4

       s1 = new YIntervalSeries("s2");

   5

       assertFalse(s1.equals(s2));

   5

       assertFalse(s1.equals(s2));

   6

       s2 = new XIntervalSeries("s2");

   6

       s2 = new YIntervalSeries("s2");

   7

       assertTrue(s1.equals(s2));

   7

       assertTrue(s1.equals(s2));

   8

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

   8

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

   9

       assertFalse(s1.equals(s2));

   9

       assertFalse(s1.equals(s2));

   10

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

   10

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

   11

       assertTrue(s1.equals(s2));

   11

       assertTrue(s1.equals(s2));

   12

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

   12

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

   13

       assertFalse(s1.equals(s2));

   13

       assertFalse(s1.equals(s2));

   14

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

   14

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

   15

       assertTrue(s1.equals(s2));

   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);

   17

       assertFalse(s1.equals(s2));

   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);

   19

       assertTrue(s2.equals(s1));

   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);

   21

       assertFalse(s1.equals(s2));

   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);

   23

       assertTrue(s2.equals(s1));

   23

       assertTrue(s2.equals(s1));

   24

       s1.remove(new Double(1.0));

   24

       s1.remove(new Double(1.0));

   25

       assertFalse(s1.equals(s2));

   25

       assertFalse(s1.equals(s2));

   26

       s2.remove(new Double(1.0));

   26

       s2.remove(new Double(1.0));

   27

       assertTrue(s2.equals(s1));

   27

       assertTrue(s2.equals(s1));

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