355-5-6

if (w == LengthConstraintType.RANGE) { if (h == LengthConstraintType.NONE) { return arrangeRN(container, g2, constraint); } else if (h == LengthConstraintType.FIXED) { return arrangeRF(container, g2, constraint); } else if (h == LengthConstraintType.RANGE) { return arrangeRR(container, g2, constraint); } }
if (h == LengthConstraintType.NONE) { contentSize = arrangeNN(container, g2); } else if (h == LengthConstraintType.FIXED) { throw new RuntimeException("Not implemented."); } else if (h == LengthConstraintType.RANGE) { throw new RuntimeException("Not implemented."); }

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

1

    if (w == LengthConstraintType.RANGE) {↵

1

    if (h == LengthConstraintType.NONE) {↵

2

                if (h == LengthConstraintType.NONE) {↵

2

                ↵

3

                    return arrangeRN(container, g2, constraint);  ↵

3

        contentSize = arrangeNN(container, g2);↵

4

                }↵

4

                }↵

5

                else if (h == LengthConstraintType.FIXED) {↵

5

                else if (h == LengthConstraintType.FIXED) {↵

6

                    return arrangeRF(container, g2, constraint);  ↵

6

                    throw new RuntimeException("Not implemented.");↵

7

                }↵

7

                }↵

8

                else if (h == LengthConstraintType.RANGE) {↵

8

                else if (h == LengthConstraintType.RANGE) {↵

9

                    return arrangeRR(container, g2, constraint);   ↵

9

                    ↵

10

                }↵

10

    throw new RuntimeException("Not implemented.");↵

11

            }

11

                }

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.7
Clones location | Clones are in different classes
Number of node comparisons | 28

1. {Non-refactorable}

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

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

   18

       if (h == LengthConstraintType.NONE)

   6

       if (h == LengthConstraintType.NONE)

   7

       contentSize = arrangeNN(container, g2);

   19

       return arrangeRN(container, g2, constraint);

   19 | return arrangeRN(container, g2, constraint);

   Preondition Violations
   Unmatched return arrangeRN(container,g2,constraint);

   20

       else if (h == LengthConstraintType.FIXED)

   8

       else if (h == LengthConstraintType.FIXED)

   9 | throw new RuntimeException("Not implemented.");

   Preondition Violations
   Unmatched throw new RuntimeException("Not implemented.");

   9

       throw new RuntimeException("Not implemented.");

   21

       return arrangeRF(container, g2, constraint);

   21 | return arrangeRF(container, g2, constraint);

   Preondition Violations
   Unmatched return arrangeRF(container,g2,constraint);

   22

       else if (h == LengthConstraintType.RANGE)

   10

       else if (h == LengthConstraintType.RANGE)

   11 | throw new RuntimeException("Not implemented.");

   Preondition Violations
   Unmatched throw new RuntimeException("Not implemented.");

   11

       throw new RuntimeException("Not implemented.");

   23

       return arrangeRR(container, g2, constraint);

   23 | return arrangeRR(container, g2, constraint);

   Preondition Violations
   Unmatched return arrangeRR(container,g2,constraint);

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Unmatched return arrangeRN(container,g2,constraint);
   2 | Unmatched throw new RuntimeException("Not implemented.");
   3 | Unmatched return arrangeRF(container,g2,constraint);
   4 | Unmatched throw new RuntimeException("Not implemented.");
   5 | Unmatched return arrangeRR(container,g2,constraint);