1661-1-2

if (this.topBlock != null) { RectangleConstraint c1 = new RectangleConstraint(widthRange, heightRange); Size2D size = this.topBlock.arrange(g2, c1); w[0] = size.width; h[0] = size.height; }
if (this.leftBlock != null) { RectangleConstraint c3 = new RectangleConstraint(widthRange, heightRange3); Size2D size = this.leftBlock.arrange(g2, c3); w[2] = size.width; h[2] = 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.topBlock != null) {↵

1

    if (this.leftBlock != null) {↵

2

                RectangleConstraint c1 = new RectangleConstraint(widthRange,↵

2

                RectangleConstraint c3 = new RectangleConstraint(widthRange,↵

3

                        heightRange);↵

3

                        heightRange3);↵

4

                Size2D size = this.topBlock.arrange(g2, c1);↵

4

                Size2D size = this.leftBlock.arrange(g2, c3);↵

5

                w[0] = size.width;↵

5

                w[2] = size.width;↵

6

                h[0] = size.height;↵

6

                h[2] = 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
   --- | --- | --- | --- | ---

   3

       if (this.topBlock != null)

   3 | if (this.topBlock != null)
   15 | if (this.leftBlock != null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   topBlock | leftBlock | VARIABLE_NAME_MISMATCH

   15

       if (this.leftBlock != null)

   4

       RectangleConstraint c1 = new RectangleConstraint(widthRange, heightRange);

   4 | RectangleConstraint c1 = new RectangleConstraint(widthRange, heightRange);
   16 | RectangleConstraint c3 = new RectangleConstraint(widthRange, heightRange3);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   c1 | c3 | VARIABLE_NAME_MISMATCH
   heightRange | heightRange3 | VARIABLE_NAME_MISMATCH

   16

       RectangleConstraint c3 = new RectangleConstraint(widthRange, heightRange3);

   5

       Size2D size = this.topBlock.arrange(g2, c1);

   5 | Size2D size = this.topBlock.arrange(g2, c1);
   17 | Size2D size = this.leftBlock.arrange(g2, c3);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   c1 | c3 | VARIABLE_NAME_MISMATCH
   topBlock | leftBlock | VARIABLE_NAME_MISMATCH

   17

       Size2D size = this.leftBlock.arrange(g2, c3);

   6

       w[0] = size.width;

   6 | w[0] = size.width;
   18 | w[2] = size.width;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   0 | 2 | LITERAL_VALUE_MISMATCH

   18

       w[2] = size.width;

   7

       h[0] = size.height;

   7 | h[0] = size.height;
   19 | h[2] = size.height;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   0 | 2 | LITERAL_VALUE_MISMATCH

   19

       h[2] = size.height;

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