1006-1-3

StackedBarRenderer r1 = new StackedBarRenderer(); StackedBarRenderer r2 = new StackedBarRenderer(); assertTrue(r1.equals(r2)); assertTrue(r2.equals(r1)); r1.setRenderAsPercentages(true); assertFalse(r1.equals(r2)); r2.setRenderAsPercentages(true); assertTrue(r1.equals(r2));
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));

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

1

    StackedBarRenderer r1 = new StackedBarRenderer();↵

1

    StackedXYBarRenderer r1 = new StackedXYBarRenderer();↵

2

            StackedBarRenderer r2 = new StackedBarRenderer();↵

2

            StackedXYBarRenderer r2 = new StackedXYBarRenderer();↵

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.setRenderAsPercentages(true);↵

6

            assertFalse(r1.equals(r2));↵

6

            assertFalse(r1.equals(r2));↵

7

            r2.setRenderAsPercentages(true);↵

7

            r2.setRenderAsPercentages(true);↵

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

1. {Non-refactorable}

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

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

   1

       StackedBarRenderer r1 = new StackedBarRenderer();

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

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

   1

       StackedXYBarRenderer r1 = new StackedXYBarRenderer();

   2

       StackedBarRenderer r2 = new StackedBarRenderer();

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

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

   2

       StackedXYBarRenderer r2 = new StackedXYBarRenderer();

   3

       assertTrue(r1.equals(r2));

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.StackedBarRenderer | org.jfree.chart.renderer.xy.StackedXYBarRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.StackedBarRenderer | org.jfree.chart.renderer.xy.StackedXYBarRenderer | 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.category.StackedBarRenderer | org.jfree.chart.renderer.xy.StackedXYBarRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.StackedBarRenderer | org.jfree.chart.renderer.xy.StackedXYBarRenderer | SUBCLASS_TYPE_MISMATCH

   4

       assertTrue(r2.equals(r1));

   5

       r1.setRenderAsPercentages(true);

   5 | r1.setRenderAsPercentages(true);
   5 | r1.setRenderAsPercentages(true);

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

   Preondition Violations
   Expression r1 cannot be unified with expression r1 , because common superclass org.jfree.chart.renderer.AbstractRenderer does not declare member(s) public void setRenderAsPercentages(boolean)

   5

       r1.setRenderAsPercentages(true);

   6

       assertFalse(r1.equals(r2));

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

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

   6

       assertFalse(r1.equals(r2));

   7

       r2.setRenderAsPercentages(true);

   7 | r2.setRenderAsPercentages(true);
   7 | r2.setRenderAsPercentages(true);

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

   Preondition Violations
   Expression r2 cannot be unified with expression r2 , because common superclass org.jfree.chart.renderer.AbstractRenderer does not declare member(s) public void setRenderAsPercentages(boolean)

   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.category.StackedBarRenderer | org.jfree.chart.renderer.xy.StackedXYBarRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.StackedBarRenderer | org.jfree.chart.renderer.xy.StackedXYBarRenderer | SUBCLASS_TYPE_MISMATCH

   8

       assertTrue(r1.equals(r2));

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Expression r1 cannot be unified with expression r1 , because common superclass org.jfree.chart.renderer.AbstractRenderer does not declare member(s) public void setRenderAsPercentages(boolean)
   2 | Expression r2 cannot be unified with expression r2 , because common superclass org.jfree.chart.renderer.AbstractRenderer does not declare member(s) public void setRenderAsPercentages(boolean)