392-2-3

DefaultIntervalXYDataset d1 = new DefaultIntervalXYDataset(); DefaultIntervalXYDataset d2 = new DefaultIntervalXYDataset(); assertTrue(d1.equals(d2)); assertTrue(d2.equals(d1)); d1 = createSampleDataset1(); assertFalse(d1.equals(d2)); d2 = createSampleDataset1(); assertTrue(d1.equals(d2));
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/data/xy/junit/DefaultIntervalXYDatasetTests.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

    DefaultIntervalXYDataset d1 = new DefaultIntervalXYDataset();↵

2

            DefaultIntervalXYDataset d2 = new DefaultIntervalXYDataset↵

1

    StackedXYBarRenderer r1 = new StackedXYBarRenderer();↵

3

    ();↵

2

            StackedXYBarRenderer r2 = new StackedXYBarRenderer();↵

4

            assertTrue(d1.equals(d2));↵

3

            assertTrue(r1.equals(r2));↵

5

            assertTrue(d2.equals(d1));↵

4

            assertTrue(r2.equals(r1));↵

6

            d1 = createSampleDataset1();↵

5

            r1.setRenderAsPercentages(true);↵

7

            assertFalse(d1.equals(d2));↵

6

            assertFalse(r1.equals(r2));↵

8

            d2 = createSampleDataset1();↵

7

            r2.setRenderAsPercentages(true);↵

9

            assertTrue(d1.equals(d2));

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

1. {Non-refactorable}

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

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

   1

       StackedXYBarRenderer r1 = new StackedXYBarRenderer();

   1

       DefaultIntervalXYDataset d1 = new DefaultIntervalXYDataset();

   2

       StackedXYBarRenderer r2 = new StackedXYBarRenderer();

   2

       DefaultIntervalXYDataset d2 = new DefaultIntervalXYDataset();

   3

       assertTrue(d1.equals(d2));

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   d2 | r2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.DefaultIntervalXYDataset | org.jfree.chart.renderer.xy.StackedXYBarRenderer | VARIABLE_TYPE_MISMATCH
   d1 | r1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.DefaultIntervalXYDataset | org.jfree.chart.renderer.xy.StackedXYBarRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

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

   3

       assertTrue(r1.equals(r2));

   4

       assertTrue(d2.equals(d1));

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   d1 | r1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.DefaultIntervalXYDataset | org.jfree.chart.renderer.xy.StackedXYBarRenderer | VARIABLE_TYPE_MISMATCH
   d2 | r2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.DefaultIntervalXYDataset | org.jfree.chart.renderer.xy.StackedXYBarRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

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

   4

       assertTrue(r2.equals(r1));

   5 | r1.setRenderAsPercentages(true);

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

   5

       r1.setRenderAsPercentages(true);

   5

       d1 = createSampleDataset1();

   5 | d1 = createSampleDataset1();

   Preondition Violations
   Unmatched statement d1=createSampleDataset1(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   6

       assertFalse(d1.equals(d2));

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   d2 | r2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.DefaultIntervalXYDataset | org.jfree.chart.renderer.xy.StackedXYBarRenderer | VARIABLE_TYPE_MISMATCH
   d1 | r1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.DefaultIntervalXYDataset | org.jfree.chart.renderer.xy.StackedXYBarRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

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

   6

       assertFalse(r1.equals(r2));

   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

   7

       r2.setRenderAsPercentages(true);

   7

       d2 = createSampleDataset1();

   7 | d2 = createSampleDataset1();

   Preondition Violations
   Unmatched statement d2=createSampleDataset1(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   8

       assertTrue(d1.equals(d2));

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   d2 | r2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.DefaultIntervalXYDataset | org.jfree.chart.renderer.xy.StackedXYBarRenderer | VARIABLE_TYPE_MISMATCH
   d1 | r1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.DefaultIntervalXYDataset | org.jfree.chart.renderer.xy.StackedXYBarRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

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

   8

       assertTrue(r1.equals(r2));

   Precondition Violations (12)
   Row | Violation
   --- | ---
   1 | Type org.jfree.data.xy.DefaultIntervalXYDataset of variable d2 does not match with type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r2
   2 | Type org.jfree.data.xy.DefaultIntervalXYDataset of variable d1 does not match with type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r1
   3 | Type org.jfree.data.xy.DefaultIntervalXYDataset of variable d1 does not match with type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r1
   4 | Type org.jfree.data.xy.DefaultIntervalXYDataset of variable d2 does not match with type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r2
   5 | Unmatched statement r1.setRenderAsPercentages(true); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   6 | Unmatched statement d1=createSampleDataset1(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   7 | Type org.jfree.data.xy.DefaultIntervalXYDataset of variable d2 does not match with type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r2
   8 | Type org.jfree.data.xy.DefaultIntervalXYDataset of variable d1 does not match with type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r1
   9 | 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
   10 | Unmatched statement d2=createSampleDataset1(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   11 | Type org.jfree.data.xy.DefaultIntervalXYDataset of variable d2 does not match with type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r2
   12 | Type org.jfree.data.xy.DefaultIntervalXYDataset of variable d1 does not match with type org.jfree.chart.renderer.xy.StackedXYBarRenderer of variable r1