1362-1-2

if (h == LengthConstraintType.NONE) { throw new RuntimeException("Not implemented."); } else if (h == LengthConstraintType.FIXED) { return arrangeRF(container, g2, constraint); } else if (h == LengthConstraintType.RANGE) { return arrangeRR(container, g2, constraint); }
if (h == LengthConstraintType.NONE) { return arrangeNN(container, g2); } else if (h == LengthConstraintType.FIXED) { return arrangeNF(container, g2, constraint); } 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/ColumnArrangement.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/block/FlowArrangement.java
Method name: `Size2D arrange(BlockContainer, Graphics2D, RectangleConstraint)` |  | Method name: `Size2D arrange(BlockContainer, Graphics2D, RectangleConstraint)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    if (h == LengthConstraintType.NONE) {↵

1

    if (h == LengthConstraintType.NONE) {↵

2

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

2

                    return arrangeNN(container, g2);  ↵

3

                }↵

3

                }↵

4

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

4

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

5

                    return arrangeRF(container, g2, constraint);  ↵

5

                    return arrangeNF(container, g2, constraint);  ↵

6

                }↵

6

                }↵

7

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

7

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

8

                    return arrangeRR(container, g2, constraint);  ↵

8

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

9

                }

9

                }

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

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 6
   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.9
   Clone type | Type 2

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

   18

       if (h == LengthConstraintType.NONE)

   18 | if (h == LengthConstraintType.NONE)
   8 | if (h == LengthConstraintType.RANGE)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   NONE | RANGE | VARIABLE_NAME_MISMATCH

   8

       if (h == LengthConstraintType.RANGE)

   19

       throw new RuntimeException("Not implemented.");

   9

       throw new RuntimeException("Not implemented.");

   20

       else if (h == LengthConstraintType.FIXED)

   6

       else if (h == LengthConstraintType.FIXED)

   21

       return arrangeRF(container, g2, constraint);

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   arrangeRF | arrangeNF | METHOD_INVOCATION_NAME_MISMATCH

   7

       return arrangeNF(container, g2, constraint);

   22

       else if (h == LengthConstraintType.RANGE)

   22 | else if (h == LengthConstraintType.RANGE)
   4 | else if (h == LengthConstraintType.NONE)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   RANGE | NONE | VARIABLE_NAME_MISMATCH

   4

       else if (h == LengthConstraintType.NONE)

   23

       return arrangeRR(container, g2, constraint);

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   arrangeRR | arrangeNN | METHOD_INVOCATION_NAME_MISMATCH
   arrangeRR(container,g2,constraint) | arrangeNN(container,g2) | ARGUMENT_NUMBER_MISMATCH

   5

       return arrangeNN(container, g2);

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