265-2-3

public void testEquals() { BoxAndWhiskerRenderer r1 = new BoxAndWhiskerRenderer(); BoxAndWhiskerRenderer r2 = new BoxAndWhiskerRenderer(); assertEquals(r1, r2); r1.setArtifactPaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 3.0f, 4.0f, Color.blue)); assertFalse(r1.equals(r2)); r2.setArtifactPaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 3.0f, 4.0f, Color.blue)); assertEquals(r1, r2); r1.setFillBox(!r1.getFillBox()); assertFalse(r1.equals(r2)); r2.setFillBox(!r2.getFillBox()); assertEquals(r1, r2); r1.setItemMargin(0.11); assertFalse(r1.equals(r2)); r2.setItemMargin(0.11); assertEquals(r1, r2); r1.setMaximumBarWidth(0.99); assertFalse(r1.equals(r2)); r2.setMaximumBarWidth(0.99); assertTrue(r1.equals(r2));
public void testEquals() { XYErrorRenderer r1 = new XYErrorRenderer(); XYErrorRenderer r2 = new XYErrorRenderer(); assertEquals(r1, r2); // drawXError r1.setDrawXError(false); assertFalse(r1.equals(r2)); r2.setDrawXError(false); assertTrue(r1.equals(r2)); // drawYError r1.setDrawYError(false); assertFalse(r1.equals(r2)); r2.setDrawYError(false); assertTrue(r1.equals(r2)); // capLength r1.setCapLength(9.0); assertFalse(r1.equals(r2)); r2.setCapLength(9.0); assertTrue(r1.equals(r2)); // errorPaint r1.setErrorPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.green)); assertFalse(r1.equals(r2)); r2.setErrorPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.green)); assertTrue(r1.equals(r2));

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/category/junit/BoxAndWhiskerRendererTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/xy/junit/XYErrorRendererTests.java
Method name: `` |  | Method name: ``
Number of AST nodes: 0 |  | Number of AST nodes: 0

1

    public void testEquals() {↵

1

    public void testEquals() {↵

2

            BoxAndWhiskerRenderer r1 = new BoxAndWhiskerRenderer();↵

2

            XYErrorRenderer r1 = new XYErrorRenderer();↵

3

            BoxAndWhiskerRenderer r2 = new BoxAndWhiskerRenderer();↵

3

            XYErrorRenderer r2 = new XYErrorRenderer();↵

4

            assertEquals(r1, r2);↵

4

            assertEquals(r1, r2);↵

5

            r1.setArtifactPaint(new GradientPaint(1.0f, 2.0f, Color.yellow,↵

5

            ↵

6

                    3.0f, 4.0f, Color.blue));↵

7

            assertFalse(r1.equals(r2));↵

8

            r2.setArtifactPaint(new GradientPaint(1.0f, 2.0f, Color.yellow,↵

9

                    3.0f, 4.0f, Color.blue)↵

6

    // drawXError↵

7

            r1.setDrawXError(false);↵

8

            assertFalse(r1.equals(r2));↵

10

    );↵

9

            r2.setDrawXError(false);↵

11

            assertEquals(r1, r2);↵

10

            assertTrue(r1.equals(r2));↵

12

            r1.setFillBox(!↵

11

            // drawYError↵

13

    r1.getFillBox());↵

12

            r1.setDrawYError(false);↵

14

            assertFalse(r1.equals(r2));↵

13

            assertFalse(r1.equals(r2));↵

15

            r2.setFillBox(!r2.getFillBox());↵

14

            r2.setDrawYError(false);↵

16

            assertEquals(r1, r2);↵

15

            assertTrue(r1.equals(r2));↵

17

            r1.setItemMargin(0.11↵

16

            // capLength↵

18

    );↵

17

            r1.setCapLength(9.0);↵

19

            assertFalse(r1.equals(r2));↵

18

            assertFalse(r1.equals(r2));↵

20

            r2.setItemMargin(0.11);↵

19

            r2.setCapLength(9.0);↵

21

            assertEquals(r1, r2);↵

20

            assertTrue(r1.equals(r2));↵

22

            r1.setMaximumBarWidth(0.99);↵

21

            ↵

23

            assertFalse(r1.equals(r2));↵

24

            r2.setMaximumBarWidth(0.99↵

22

    // errorPaint↵

23

            r1.setErrorPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f,↵

24

                    Color.green));↵

25

            assertFalse(r1.equals(r2));↵

26

            r2.setErrorPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f,↵

25

    );↵

27

                    Color.green));↵

26

            assertTrue(r1.equals(r2));↵

28

            assertTrue(r1.equals(r2));↵

27

29

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