1661-3-4

if (this.rightBlock != null) { RectangleConstraint c4 = new RectangleConstraint(widthRange2, heightRange3); Size2D size = this.rightBlock.arrange(g2, c4); w[3] = size.width; h[3] = size.height; }
if (this.centerBlock != null) { RectangleConstraint c5 = new RectangleConstraint(widthRange3, heightRange3); Size2D size = this.centerBlock.arrange(g2, c5); w[4] = size.width; h[4] = size.height; }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/BorderArrangement.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/block/BorderArrangement.java
Method name: `Size2D arrangeRR(BlockContainer, Range, Range, Graphics2D)` |  | Method name: `Size2D arrangeRR(BlockContainer, Range, Range, Graphics2D)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    if (this.rightBlock != null) {↵

1

    if (this.centerBlock != null) {↵

2

                RectangleConstraint c4 = new RectangleConstraint(widthRange2,↵

2

                RectangleConstraint c5 = new RectangleConstraint(widthRange3,↵

3

                        heightRange3);↵

3

                        heightRange3);↵

4

                Size2D size = this.rightBlock.arrange(g2, c4);↵

4

                Size2D size = this.centerBlock.arrange(g2, c5);↵

5

                w[3] = size.width;↵

5

                w[4] = size.width;↵

6

                h[3] = size.height;↵

6

                h[4] = size.height;↵

7

            }

7

            }

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.1
Clones location | Clones are in the same method
Number of node comparisons | 25

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 5
   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) | 1.3
   Clone type | Type 2

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

   21

       if (this.rightBlock != null)

   21 | if (this.rightBlock != null)
   29 | if (this.centerBlock != null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   rightBlock | centerBlock | VARIABLE_NAME_MISMATCH

   29

       if (this.centerBlock != null)

   22

       RectangleConstraint c4 = new RectangleConstraint(widthRange2, heightRange3);

   22 | RectangleConstraint c4 = new RectangleConstraint(widthRange2, heightRange3);
   30 | RectangleConstraint c5 = new RectangleConstraint(widthRange3, heightRange3);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   c4 | c5 | VARIABLE_NAME_MISMATCH
   widthRange2 | widthRange3 | VARIABLE_NAME_MISMATCH

   30

       RectangleConstraint c5 = new RectangleConstraint(widthRange3, heightRange3);

   23

       Size2D size = this.rightBlock.arrange(g2, c4);

   23 | Size2D size = this.rightBlock.arrange(g2, c4);
   31 | Size2D size = this.centerBlock.arrange(g2, c5);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   c4 | c5 | VARIABLE_NAME_MISMATCH
   rightBlock | centerBlock | VARIABLE_NAME_MISMATCH

   31

       Size2D size = this.centerBlock.arrange(g2, c5);

   24

       w[3] = size.width;

   24 | w[3] = size.width;
   32 | w[4] = size.width;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   3 | 4 | LITERAL_VALUE_MISMATCH

   32

       w[4] = size.width;

   25

       h[3] = size.height;

   25 | h[3] = size.height;
   33 | h[4] = size.height;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   3 | 4 | LITERAL_VALUE_MISMATCH

   33

       h[4] = size.height;

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Clone fragment #1 returns variables h, w , while Clone fragment #2 returns variables w, h