1007-6-7

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));
CustomPieURLGenerator g1 = new CustomPieURLGenerator(); CustomPieURLGenerator g2 = new CustomPieURLGenerator(); assertTrue(g1.equals(g2)); Map m1 = new HashMap(); m1.put("A", "http://www.jfree.org/"); g1.addURLs(m1); assertFalse(g1.equals(g2)); g2.addURLs(m1); assertTrue(g1.equals(g2));

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/urls/junit/CustomPieURLGeneratorTests.java
Method name: `void testEquals()` |  | Method name: `void testEquals()`
Number of AST nodes: 8 |  | Number of AST nodes: 9

1

    StackedXYBarRenderer r1 = new StackedXYBarRenderer();↵

1

    CustomPieURLGenerator g1 = new CustomPieURLGenerator();↵

2

            StackedXYBarRenderer r2 = new StackedXYBarRenderer();↵

2

            CustomPieURLGenerator g2 = new CustomPieURLGenerator();↵

3

            assertTrue(r1.equals(r2));↵

3

            assertTrue(g1.equals(g2));↵

4

            assertTrue(r2.equals(r1));↵

4

            Map m1 = new HashMap();↵

5

            r1.setRenderAsPercentages(true↵

5

            m1.put("A", "http://www.jfree.org/");↵

6

    );↵

6

            g1.addURLs(m1);↵

7

            assertFalse(r1.equals(r2));↵

7

            assertFalse(g1.equals(g2));↵

8

            r2.setRenderAsPercentages(true);↵

8

            g2.addURLs(m1);↵

9

            assertTrue(r1.equals(r2));

9

            assertTrue(g1.equals(g2));

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

1. {Non-refactorable}

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

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

   1

       CustomPieURLGenerator g1 = new CustomPieURLGenerator();

   1

       StackedXYBarRenderer r1 = new StackedXYBarRenderer();

   2

       CustomPieURLGenerator g2 = new CustomPieURLGenerator();

   2

       StackedXYBarRenderer r2 = new StackedXYBarRenderer();

   3

       assertTrue(r1.equals(r2));

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   r2 | g2 | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.urls.CustomPieURLGenerator | VARIABLE_TYPE_MISMATCH
   r1 | g1 | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.urls.CustomPieURLGenerator | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r2 does not match with type org.jfree.chart.urls.CustomPieURLGenerator of variable g2
   - Make classes org.jfree.chart.renderer.xy.StackedXYBarRenderer and org.jfree.chart.urls.CustomPieURLGenerator extend a common superclass

   Type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r1 does not match with type org.jfree.chart.urls.CustomPieURLGenerator of variable g1
   - Make classes org.jfree.chart.renderer.xy.StackedXYBarRenderer and org.jfree.chart.urls.CustomPieURLGenerator extend a common superclass

   3

       assertTrue(g1.equals(g2));

   4

       Map m1 = new HashMap();

   5

       m1.put("A", "http://www.jfree.org/");

   6 | g1.addURLs(m1);

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

   6

       g1.addURLs(m1);

   8

       g2.addURLs(m1);

   4

       assertTrue(r2.equals(r1));

   4 | assertTrue(r2.equals(r1));
   9 | assertTrue(g1.equals(g2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   r1 | g2 | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.urls.CustomPieURLGenerator | VARIABLE_TYPE_MISMATCH
   r2 | g1 | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.StackedXYBarRenderer | org.jfree.chart.urls.CustomPieURLGenerator | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r1 does not match with type org.jfree.chart.urls.CustomPieURLGenerator of variable g2
   - Make classes org.jfree.chart.renderer.xy.StackedXYBarRenderer and org.jfree.chart.urls.CustomPieURLGenerator extend a common superclass

   Type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r2 does not match with type org.jfree.chart.urls.CustomPieURLGenerator of variable g1
   - Make classes org.jfree.chart.renderer.xy.StackedXYBarRenderer and org.jfree.chart.urls.CustomPieURLGenerator extend a common superclass

   9

       assertTrue(g1.equals(g2));

   5

       r1.setRenderAsPercentages(true);

   5 | r1.setRenderAsPercentages(true);
   7 | assertFalse(g1.equals(g2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   setRenderAsPercentages | assertFalse | METHOD_INVOCATION_NAME_MISMATCH
   true | g1.equals(g2) | 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 r1.setRenderAsPercentages(true) is a void method call, and thus it cannot be parameterized
   Expression assertFalse(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   Expression r1.setRenderAsPercentages(true) 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(g1.equals(g2)) is a void method call, and thus it cannot be parameterized

   7

       assertFalse(g1.equals(g2));

   6

       assertFalse(r1.equals(r2));

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

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

   7

       r2.setRenderAsPercentages(true);

   7 | r2.setRenderAsPercentages(true);

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

   8

       assertTrue(r1.equals(r2));

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

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

   Precondition Violations (14)
   Row | Violation
   --- | ---
   1 | Type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r2 does not match with type org.jfree.chart.urls.CustomPieURLGenerator of variable g2
   2 | Type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r1 does not match with type org.jfree.chart.urls.CustomPieURLGenerator of variable g1
   3 | Unmatched statement g1.addURLs(m1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   4 | Type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r1 does not match with type org.jfree.chart.urls.CustomPieURLGenerator of variable g2
   5 | Type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r2 does not match with type org.jfree.chart.urls.CustomPieURLGenerator of variable g1
   6 | Expression r1.setRenderAsPercentages(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression r1.setRenderAsPercentages(true) is a void method call, and thus it cannot be parameterized
   8 | Expression assertFalse(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   9 | Expression r1.setRenderAsPercentages(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   10 | Expression r1.setRenderAsPercentages(true) is a void method call, and thus it cannot be parameterized
   11 | Expression assertFalse(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   12 | Unmatched statement assertFalse(r1.equals(r2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   13 | Unmatched statement r2.setRenderAsPercentages(true); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   14 | Unmatched statement assertTrue(r1.equals(r2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted