392-3-4

StackedXYBarRenderer r1 = new StackedXYBarRenderer(); StackedXYBarRenderer r2 = new StackedXYBarRenderer(); assertTrue(r1.equals(r2)); assertTrue(r2.equals(r1)); r1.setRenderAsPercentages(true); assertFalse(r1.equals(r2)); r2.setRenderAsPercentages(true); assertTrue(r1.equals(r2));
DeviationRenderer r1 = new DeviationRenderer(); DeviationRenderer r2 = new DeviationRenderer(); assertTrue(r1.equals(r2)); assertTrue(r2.equals(r1)); r1.setAlpha(0.1f); assertFalse(r1.equals(r2)); r2.setAlpha(0.1f); assertTrue(r1.equals(r2));

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

1

    StackedXYBarRenderer r1 = new StackedXYBarRenderer();↵

1

    DeviationRenderer r1 = new DeviationRenderer();↵

2

            StackedXYBarRenderer r2 = new StackedXYBarRenderer();↵

2

            DeviationRenderer r2 = new DeviationRenderer();↵

3

            assertTrue(r1.equals(r2));↵

3

            assertTrue(r1.equals(r2));↵

4

            assertTrue(r2.equals(r1));↵

4

            assertTrue(r2.equals(r1));↵

5

            r1.setRenderAsPercentages(true);↵

5

            r1.setAlpha(0.1f);↵

6

            assertFalse(r1.equals(r2));↵

6

            assertFalse(r1.equals(r2));↵

7

            r2.setRenderAsPercentages(true);↵

7

            r2.setAlpha(0.1f);↵

8

            assertTrue(r1.equals(r2));

8

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

1. {Non-refactorable}

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

       StackedXYBarRenderer r1 = new StackedXYBarRenderer();

   1 | StackedXYBarRenderer r1 = new StackedXYBarRenderer();
   1 | DeviationRenderer r1 = new DeviationRenderer();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH

   1

       DeviationRenderer r1 = new DeviationRenderer();

   2

       StackedXYBarRenderer r2 = new StackedXYBarRenderer();

   2 | StackedXYBarRenderer r2 = new StackedXYBarRenderer();
   2 | DeviationRenderer r2 = new DeviationRenderer();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH

   2

       DeviationRenderer r2 = new DeviationRenderer();

   3

       assertTrue(r1.equals(r2));

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH

   3

       assertTrue(r1.equals(r2));

   4

       assertTrue(r2.equals(r1));

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH

   4

       assertTrue(r2.equals(r1));

   5 | r1.setAlpha(0.1f);

   Preondition Violations
   Unmatched statement r1.setAlpha(0.1f); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   5

       r1.setAlpha(0.1f);

   5

       r1.setRenderAsPercentages(true);

   5 | r1.setRenderAsPercentages(true);
   6 | assertFalse(r1.equals(r2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   setRenderAsPercentages | assertFalse | METHOD_INVOCATION_NAME_MISMATCH
   true | r1.equals(r2) | TYPE_COMPATIBLE_REPLACEMENT
   r1 |  | MISSING_METHOD_INVOCATION_EXPRESSION

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

   6

       assertFalse(r1.equals(r2));

   6

       assertFalse(r1.equals(r2));

   7

       r2.setAlpha(0.1f);

   7

       r2.setRenderAsPercentages(true);

   8

       assertTrue(r1.equals(r2));

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.renderer.xy.DeviationRenderer | SUBCLASS_TYPE_MISMATCH

   8

       assertTrue(r1.equals(r2));

   Precondition Violations (11)
   Row | Violation
   --- | ---
   1 | Unmatched statement r1.setAlpha(0.1f); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   2 | Expression r1.setRenderAsPercentages(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression assertFalse(r1.equals(r2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression r1.setRenderAsPercentages(true) is a void method call, and thus it cannot be parameterized
   5 | Expression assertFalse(r1.equals(r2)) is a void method call, and thus it cannot be parameterized
   6 | Expression r1.equals(r2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression r1.setRenderAsPercentages(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   8 | Expression assertFalse(r1.equals(r2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   9 | Expression r1.setRenderAsPercentages(true) is a void method call, and thus it cannot be parameterized
   10 | Expression assertFalse(r1.equals(r2)) is a void method call, and thus it cannot be parameterized
   11 | Clone fragment #1 returns variables r1, r2 , while Clone fragment #2 returns variables r1, r2