1007-2-5

StatisticalLineAndShapeRenderer r1 = new StatisticalLineAndShapeRenderer(); StatisticalLineAndShapeRenderer r2 = new StatisticalLineAndShapeRenderer(); assertTrue(r1.equals(r2)); assertTrue(r2.equals(r1)); r1.setErrorIndicatorPaint(Color.red); assertFalse(r1.equals(r2)); r2.setErrorIndicatorPaint(Color.red); assertTrue(r2.equals(r1));
StackedXYAreaRenderer2 r1 = new StackedXYAreaRenderer2(); StackedXYAreaRenderer2 r2 = new StackedXYAreaRenderer2(); assertEquals(r1, r2); assertEquals(r2, r1); r1.setRoundXCoordinates(!r1.getRoundXCoordinates()); assertFalse(r1.equals(r2)); r2.setRoundXCoordinates(r1.getRoundXCoordinates()); assertTrue(r1.equals(r2));

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/category/junit/StatisticalLineAndShapeRendererTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/xy/junit/StackedXYAreaRenderer2Tests.java
Method name: `void testEquals()` |  | Method name: `void testEquals()`
Number of AST nodes: 8 |  | Number of AST nodes: 8

1

    StatisticalLineAndShapeRenderer r1↵

1

    StackedXYAreaRenderer2 r1↵

2

                = new StatisticalLineAndShapeRenderer();↵

2

     = new StackedXYAreaRenderer2();↵

3

            StatisticalLineAndShapeRenderer r2↵

3

            StackedXYAreaRenderer2 r2↵

4

                = new StatisticalLineAndShapeRenderer();↵

4

     = new StackedXYAreaRenderer2();↵

5

            assertTrue(r1.equals(r2));↵

5

            assertEquals(r1, r2);↵

6

            assertTrue(r2.equals(r1));↵

6

            assertEquals(r2, r1);↵

7

            r1.setErrorIndicatorPaint(Color.red);↵

7

            r1.setRoundXCoordinates(!r1.getRoundXCoordinates());↵

8

            assertFalse(r1.equals(r2));↵

8

            assertFalse(r1.equals(r2));↵

9

            r2.setErrorIndicatorPaint(Color.red);↵

9

            r2.setRoundXCoordinates(r1.getRoundXCoordinates());↵

10

            assertTrue(r2.equals(r1));

10

            assertTrue(r1.equals(r2));

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

1. {Non-refactorable}

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

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

   1

       StatisticalLineAndShapeRenderer r1 = new StatisticalLineAndShapeRenderer();

   1 | StatisticalLineAndShapeRenderer r1 = new StatisticalLineAndShapeRenderer();
   1 | StackedXYAreaRenderer2 r1 = new StackedXYAreaRenderer2();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer | org.jfree.chart.renderer.xy.StackedXYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer | org.jfree.chart.renderer.xy.StackedXYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer | org.jfree.chart.renderer.xy.StackedXYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH

   1

       StackedXYAreaRenderer2 r1 = new StackedXYAreaRenderer2();

   2

       StatisticalLineAndShapeRenderer r2 = new StatisticalLineAndShapeRenderer();

   2 | StatisticalLineAndShapeRenderer r2 = new StatisticalLineAndShapeRenderer();
   2 | StackedXYAreaRenderer2 r2 = new StackedXYAreaRenderer2();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer | org.jfree.chart.renderer.xy.StackedXYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer | org.jfree.chart.renderer.xy.StackedXYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer | org.jfree.chart.renderer.xy.StackedXYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH

   2

       StackedXYAreaRenderer2 r2 = new StackedXYAreaRenderer2();

   3

       assertTrue(r1.equals(r2));

   3 | assertTrue(r1.equals(r2));
   8 | assertTrue(r1.equals(r2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer | org.jfree.chart.renderer.xy.StackedXYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer | org.jfree.chart.renderer.xy.StackedXYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH

   8

       assertTrue(r1.equals(r2));

   4

       assertTrue(r2.equals(r1));

   4 | assertTrue(r2.equals(r1));
   4 | assertEquals(r2, r1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   assertTrue | assertEquals | METHOD_INVOCATION_NAME_MISMATCH
   assertTrue(r2.equals(r1)) | assertEquals(r2,r1) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression assertTrue(r2.equals(r1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertEquals(r2,r1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertTrue(r2.equals(r1)) is a void method call, and thus it cannot be parameterized
   Expression assertEquals(r2,r1) is a void method call, and thus it cannot be parameterized
   Expression assertTrue(r2.equals(r1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertEquals(r2,r1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertTrue(r2.equals(r1)) is a void method call, and thus it cannot be parameterized
   Expression assertEquals(r2,r1) is a void method call, and thus it cannot be parameterized

   4

       assertEquals(r2, r1);

   5

       r1.setErrorIndicatorPaint(Color.red);

   5 | r1.setErrorIndicatorPaint(Color.red);
   3 | assertEquals(r1, r2);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   setErrorIndicatorPaint | assertEquals | METHOD_INVOCATION_NAME_MISMATCH
   r1.setErrorIndicatorPaint(Color.red) | assertEquals(r1,r2) | ARGUMENT_NUMBER_MISMATCH
   r1 |  | MISSING_METHOD_INVOCATION_EXPRESSION

   Preondition Violations
   Expression r1.setErrorIndicatorPaint(Color.red) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertEquals(r1,r2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression r1.setErrorIndicatorPaint(Color.red) is a void method call, and thus it cannot be parameterized
   Expression assertEquals(r1,r2) is a void method call, and thus it cannot be parameterized
   Expression r1.setErrorIndicatorPaint(Color.red) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertEquals(r1,r2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression r1.setErrorIndicatorPaint(Color.red) is a void method call, and thus it cannot be parameterized
   Expression assertEquals(r1,r2) is a void method call, and thus it cannot be parameterized

   3

       assertEquals(r1, r2);

   6

       assertFalse(r1.equals(r2));

   6 | assertFalse(r1.equals(r2));
   6 | assertFalse(r1.equals(r2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer | org.jfree.chart.renderer.xy.StackedXYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer | org.jfree.chart.renderer.xy.StackedXYAreaRenderer2 | SUBCLASS_TYPE_MISMATCH

   6

       assertFalse(r1.equals(r2));

   7

       r2.setErrorIndicatorPaint(Color.red);

   7 | r2.setErrorIndicatorPaint(Color.red);

   Preondition Violations
   Unmatched statement r2.setErrorIndicatorPaint(Color.red); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   8

       assertTrue(r2.equals(r1));

   8 | assertTrue(r2.equals(r1));
   5 | r1.setRoundXCoordinates(! r1.getRoundXCoordinates());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   assertTrue | setRoundXCoordinates | METHOD_INVOCATION_NAME_MISMATCH
   r2.equals(r1) | !r1.getRoundXCoordinates() | TYPE_COMPATIBLE_REPLACEMENT
   | r1 | MISSING_METHOD_INVOCATION_EXPRESSION

   Preondition Violations
   Expression assertTrue(r2.equals(r1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression r1.setRoundXCoordinates(!r1.getRoundXCoordinates()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertTrue(r2.equals(r1)) is a void method call, and thus it cannot be parameterized
   Expression r1.setRoundXCoordinates(!r1.getRoundXCoordinates()) is a void method call, and thus it cannot be parameterized
   Expression r2.equals(r1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression !r1.getRoundXCoordinates() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertTrue(r2.equals(r1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression r1.setRoundXCoordinates(!r1.getRoundXCoordinates()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertTrue(r2.equals(r1)) is a void method call, and thus it cannot be parameterized
   Expression r1.setRoundXCoordinates(!r1.getRoundXCoordinates()) is a void method call, and thus it cannot be parameterized

   5

       r1.setRoundXCoordinates(!r1.getRoundXCoordinates());

   7

       r2.setRoundXCoordinates(r1.getRoundXCoordinates());

   Precondition Violations (28)
   Row | Violation
   --- | ---
   1 | Expression assertTrue(r2.equals(r1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression assertEquals(r2,r1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression assertTrue(r2.equals(r1)) is a void method call, and thus it cannot be parameterized
   4 | Expression assertEquals(r2,r1) is a void method call, and thus it cannot be parameterized
   5 | Expression assertTrue(r2.equals(r1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Expression assertEquals(r2,r1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression assertTrue(r2.equals(r1)) is a void method call, and thus it cannot be parameterized
   8 | Expression assertEquals(r2,r1) is a void method call, and thus it cannot be parameterized
   9 | Expression r1.setErrorIndicatorPaint(Color.red) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   10 | Expression assertEquals(r1,r2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   11 | Expression r1.setErrorIndicatorPaint(Color.red) is a void method call, and thus it cannot be parameterized
   12 | Expression assertEquals(r1,r2) is a void method call, and thus it cannot be parameterized
   13 | Expression r1.setErrorIndicatorPaint(Color.red) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   14 | Expression assertEquals(r1,r2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   15 | Expression r1.setErrorIndicatorPaint(Color.red) is a void method call, and thus it cannot be parameterized
   16 | Expression assertEquals(r1,r2) is a void method call, and thus it cannot be parameterized
   17 | Unmatched statement r2.setErrorIndicatorPaint(Color.red); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   18 | Expression assertTrue(r2.equals(r1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   19 | Expression r1.setRoundXCoordinates(!r1.getRoundXCoordinates()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   20 | Expression assertTrue(r2.equals(r1)) is a void method call, and thus it cannot be parameterized
   21 | Expression r1.setRoundXCoordinates(!r1.getRoundXCoordinates()) is a void method call, and thus it cannot be parameterized
   22 | Expression r2.equals(r1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   23 | Expression !r1.getRoundXCoordinates() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   24 | Expression assertTrue(r2.equals(r1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   25 | Expression r1.setRoundXCoordinates(!r1.getRoundXCoordinates()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   26 | Expression assertTrue(r2.equals(r1)) is a void method call, and thus it cannot be parameterized
   27 | Expression r1.setRoundXCoordinates(!r1.getRoundXCoordinates()) is a void method call, and thus it cannot be parameterized
   28 | Clone fragment #1 returns variables r2 , while Clone fragment #2 returns variables r1, r2