243-2-3

XYCoordinate v1 = new XYCoordinate(1.0, 2.0); XYCoordinate v2 = new XYCoordinate(1.0, 2.0); assertTrue(v1.equals(v2)); assertTrue(v2.equals(v1)); v1 = new XYCoordinate(1.1, 2.0); assertFalse(v1.equals(v2)); v2 = new XYCoordinate(1.1, 2.0); assertTrue(v1.equals(v2)); v1 = new XYCoordinate(1.1, 2.2); assertFalse(v1.equals(v2)); v2 = new XYCoordinate(1.1, 2.2); assertTrue(v1.equals(v2));
EmptyBlock b1 = new EmptyBlock(1.0, 2.0); EmptyBlock b2 = new EmptyBlock(1.0, 2.0); assertTrue(b1.equals(b2)); assertTrue(b2.equals(b2)); b1 = new EmptyBlock(1.1, 2.0); assertFalse(b1.equals(b2)); b2 = new EmptyBlock(1.1, 2.0); assertTrue(b1.equals(b2)); b1 = new EmptyBlock(1.1, 2.2); assertFalse(b1.equals(b2)); b2 = new EmptyBlock(1.1, 2.2); assertTrue(b1.equals(b2));

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XYCoordinateTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/chart/block/junit/EmptyBlockTests.java
Method name: `void testEquals()` |  | Method name: `void testEquals()`
Number of AST nodes: 12 |  | Number of AST nodes: 12

1

    XYCoordinate v1 = new XYCoordinate(1.0, 2.0);↵

1

    EmptyBlock b1 = new EmptyBlock(1.0, 2.0);↵

2

            XYCoordinate v2 = new XYCoordinate(1.0, 2.0);↵

2

            EmptyBlock b2 = new EmptyBlock(1.0, 2.0);↵

3

            assertTrue(v1.equals(v2));↵

3

            assertTrue(b1.equals(b2));↵

4

            assertTrue(v2.equals(v1));↵

4

            assertTrue(b2.equals(b2));↵

5

            ↵

5

            v1 = new XYCoordinate(1.1, 2.0);↵

6

            b1 = new EmptyBlock(1.1, 2.0);↵

6

            assertFalse(v1.equals(v2));↵

7

            assertFalse(b1.equals(b2));↵

7

            v2 = new XYCoordinate(1.1, 2.0);↵

8

            b2 = new EmptyBlock(1.1, 2.0);↵

8

            assertTrue(v1.equals(v2));↵

9

            assertTrue(b1.equals(b2));↵

9

            ↵

10

            v1 = new XYCoordinate(1.1, 2.2);↵

10

            b1 = new EmptyBlock(1.1, 2.2);↵

11

            assertFalse(v1.equals(v2));↵

11

            assertFalse(b1.equals(b2));↵

12

            v2 = new XYCoordinate(1.1, 2.2);↵

12

            b2 = new EmptyBlock(1.1, 2.2);↵

13

            assertTrue(v1.equals(v2));

13

            assertTrue(b1.equals(b2));

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

1. {Non-refactorable}

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

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

   1

       EmptyBlock b1 = new EmptyBlock(1.0, 2.0);

   1

       XYCoordinate v1 = new XYCoordinate(1.0, 2.0);

   2

       EmptyBlock b2 = new EmptyBlock(1.0, 2.0);

   2

       XYCoordinate v2 = new XYCoordinate(1.0, 2.0);

   3

       assertTrue(v1.equals(v2));

   3 | assertTrue(v1.equals(v2));
   3 | assertTrue(b1.equals(b2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | b2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH
   v1 | b1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.xy.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b1
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   3

       assertTrue(b1.equals(b2));

   4

       assertTrue(v2.equals(v1));

   4 | assertTrue(v2.equals(v1));
   4 | assertTrue(b2.equals(b2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v1 | b2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH
   v2 | b2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   Type org.jfree.data.xy.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   4

       assertTrue(b2.equals(b2));

   5 | b1 = new EmptyBlock(1.1, 2.0);

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

   5

       b1 = new EmptyBlock(1.1, 2.0);

   5

       v1 = new XYCoordinate(1.1, 2.0);

   5 | v1 = new XYCoordinate(1.1, 2.0);

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

   6

       assertFalse(v1.equals(v2));

   6 | assertFalse(v1.equals(v2));
   6 | assertFalse(b1.equals(b2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | b2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH
   v1 | b1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.xy.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b1
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   6

       assertFalse(b1.equals(b2));

   7 | b2 = new EmptyBlock(1.1, 2.0);

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

   7

       b2 = new EmptyBlock(1.1, 2.0);

   7

       v2 = new XYCoordinate(1.1, 2.0);

   7 | v2 = new XYCoordinate(1.1, 2.0);

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

   8

       assertTrue(v1.equals(v2));

   8 | assertTrue(v1.equals(v2));
   8 | assertTrue(b1.equals(b2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | b2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH
   v1 | b1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.xy.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b1
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   8

       assertTrue(b1.equals(b2));

   9 | b1 = new EmptyBlock(1.1, 2.2);

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

   9

       b1 = new EmptyBlock(1.1, 2.2);

   9

       v1 = new XYCoordinate(1.1, 2.2);

   9 | v1 = new XYCoordinate(1.1, 2.2);

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

   10

       assertFalse(v1.equals(v2));

   10 | assertFalse(v1.equals(v2));
   10 | assertFalse(b1.equals(b2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | b2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH
   v1 | b1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.xy.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b1
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   10

       assertFalse(b1.equals(b2));

   11 | b2 = new EmptyBlock(1.1, 2.2);

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

   11

       b2 = new EmptyBlock(1.1, 2.2);

   11

       v2 = new XYCoordinate(1.1, 2.2);

   11 | v2 = new XYCoordinate(1.1, 2.2);

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

   12

       assertTrue(v1.equals(v2));

   12 | assertTrue(v1.equals(v2));
   12 | assertTrue(b1.equals(b2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v2 | b2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH
   v1 | b1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.xy.XYCoordinate | org.jfree.chart.block.EmptyBlock | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.xy.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b1
   - Make classes org.jfree.data.xy.XYCoordinate and org.jfree.chart.block.EmptyBlock extend a common superclass

   12

       assertTrue(b1.equals(b2));

   Precondition Violations (20)
   Row | Violation
   --- | ---
   1 | Type org.jfree.data.xy.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   2 | Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b1
   3 | Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   4 | Type org.jfree.data.xy.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   5 | Unmatched statement b1=new EmptyBlock(1.1,2.0); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   6 | Unmatched statement v1=new XYCoordinate(1.1,2.0); 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.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   8 | Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b1
   9 | Unmatched statement b2=new EmptyBlock(1.1,2.0); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   10 | Unmatched statement v2=new XYCoordinate(1.1,2.0); 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.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   12 | Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b1
   13 | Unmatched statement b1=new EmptyBlock(1.1,2.2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   14 | Unmatched statement v1=new XYCoordinate(1.1,2.2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   15 | Type org.jfree.data.xy.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   16 | Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b1
   17 | Unmatched statement b2=new EmptyBlock(1.1,2.2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   18 | Unmatched statement v2=new XYCoordinate(1.1,2.2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   19 | Type org.jfree.data.xy.XYCoordinate of variable v2 does not match with type org.jfree.chart.block.EmptyBlock of variable b2
   20 | Type org.jfree.data.xy.XYCoordinate of variable v1 does not match with type org.jfree.chart.block.EmptyBlock of variable b1