151-1-2

public void testEquals() { 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));
public void testEquals() { 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));

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/XIntervalSeriesTests.java
Method name: `` |  | Method name: ``
Number of AST nodes: 0 |  | Number of AST nodes: 0

1

    public void testEquals() {↵

1

    public void testEquals() {↵

2

            ↵

3

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

2

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

4

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

3

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

5

            assertTrue(s1.equals(s2));↵

4

            assertTrue(s1.equals(s2));↵

6

            ↵

7

            // seriesKey↵

5

            // seriesKey↵

8

            s1 = new VectorSeries("s2");↵

6

            s1 = new XIntervalSeries("s2");↵

9

            assertFalse(s1.equals(s2));↵

7

            assertFalse(s1.equals(s2));↵

10

            s2 = new VectorSeries("s2");↵

8

            s2 = new XIntervalSeries("s2");↵

11

            assertTrue(s1.equals(s2));↵

9

            assertTrue(s1.equals(s2));↵

12

            ↵

13

            // autoSort↵

10

            // autoSort↵

14

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

11

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

15

            assertFalse(s1.equals(s2));↵

12

            assertFalse(s1.equals(s2));↵

16

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

13

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

17

            assertTrue(s1.equals(s2));↵

14

            assertTrue(s1.equals(s2));↵

18

            ↵

19

            // allowDuplicateValues↵

15

            // allowDuplicateValues↵

20

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

16

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

21

            assertFalse(s1.equals(s2));↵

17

            assertFalse(s1.equals(s2));↵

22

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

18

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

23

            assertTrue(s1.equals(s2));↵

19

            assertTrue(s1.equals(s2));↵

24

            ↵

25

            // add a value↵

20

            // add a value↵

26

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

21

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

27

            assertFalse(s1.equals(s2));↵

22

            assertFalse(s1.equals(s2));↵

28

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

23

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

29

            assertTrue(s2.equals(s1));↵

24

            assertTrue(s2.equals(s1));↵

30

            // add another value↵

25

            // add another value↵

31

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

26

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

32

            assertFalse(s1.equals(s2));↵

27

            assertFalse(s1.equals(s2));↵

33

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

28

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

34

            assertTrue(s2.equals(s1));↵

29

            assertTrue(s2.equals(s1));↵

35

            // remove a value↵

30

            // remove a value↵

36

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

31

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

37

            assertFalse(s1.equals(s2));↵

32

            assertFalse(s1.equals(s2));↵

38

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

33

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

39

            assertTrue(s2.equals(s1));↵

34

            assertTrue(s2.equals(s1));

40

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 0
Number of refactorable cases | 0
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location |
Number of node comparisons | 0