1488-1-2

if (this.topBlock != null) { RectangleConstraint c1 = new RectangleConstraint(w[0], null, LengthConstraintType.FIXED, 0.0, new Range(0.0, constraint.getHeight()), LengthConstraintType.RANGE); Size2D size = this.topBlock.arrange(g2, c1); h[0] = size.height; }
RectangleConstraint c2 = new RectangleConstraint(w[0], null, LengthConstraintType.FIXED, 0.0, new Range(0.0, constraint.getHeight() - h[0]), LengthConstraintType.RANGE); Size2D size = this.bottomBlock.arrange(g2, c2); h[1] = 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 arrangeFF(BlockContainer, Graphics2D, RectangleConstraint)` |  | Method name: `Size2D arrangeFF(BlockContainer, Graphics2D, RectangleConstraint)`
Number of AST nodes: 4 |  | Number of AST nodes: 3

1

    if (this.topBlock != null) {↵

2

                RectangleConstraint c1 = new RectangleConstraint(w[0], null,↵

1

    RectangleConstraint c2 = new RectangleConstraint(w[0], null,↵

3

                        LengthConstraintType.FIXED, 0.0,↵

2

                        LengthConstraintType.FIXED, 0.0, new Range(0.0,↵

4

                        new Range(0.0, constraint.getHeight()),↵

3

                        constraint.getHeight()↵

5

                        LengthConstraintType.RANGE);↵

4

     - h[0]), LengthConstraintType.RANGE);↵

6

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

5

                Size2D size = this.bottomBlock.arrange(g2, c2);↵

7

                h[0] = size.height;↵

6

                h[1] = size.height;

8

            }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location | Clones are in the same method
Number of node comparisons | 5

1. {Refactorable}

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

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

   5

       RectangleConstraint c1 = new RectangleConstraint(w[0], null, LengthConstraintType.FIXED, 0.0, new Range(0.0, constraint.getHeight()), LengthConstraintType.RANGE);

   5 | RectangleConstraint c1 = new RectangleConstraint(w[0], null, LengthConstraintType.FIXED, 0.0, new Range(0.0, constraint.getHeight()), LengthConstraintType.RANGE);
   10 | RectangleConstraint c2 = new RectangleConstraint(w[0], null, LengthConstraintType.FIXED, 0.0, new Range(0.0, constraint.getHeight() - h[0]), LengthConstraintType.RANGE);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   c1 | c2 | VARIABLE_NAME_MISMATCH
   constraint.getHeight() | constraint.getHeight() - h[0] | TYPE_COMPATIBLE_REPLACEMENT

   10

       RectangleConstraint c2 = new RectangleConstraint(w[0], null, LengthConstraintType.FIXED, 0.0, new Range(0.0, constraint.getHeight() - h[0]), LengthConstraintType.RANGE);

   6

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

   6 | Size2D size = this.topBlock.arrange(g2, c1);
   11 | Size2D size = this.bottomBlock.arrange(g2, c2);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   c1 | c2 | VARIABLE_NAME_MISMATCH
   topBlock | bottomBlock | VARIABLE_NAME_MISMATCH

   11

       Size2D size = this.bottomBlock.arrange(g2, c2);

   7

       h[0] = size.height;

   7 | h[0] = size.height;
   12 | h[1] = size.height;

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

   12

       h[1] = size.height;

   Precondition Violations (0)
   Row | Violation
   --- | ---