1482-2-3

result = HashUtilities.hashCode(result, list.getPaint(0)); if (size > 1) { result = HashUtilities.hashCode(result, list.getPaint(size - 1)); if (size > 2) { result = HashUtilities.hashCode(result, list.getPaint(size / 2)); } }
result = HashUtilities.hashCode(result, list.getStroke(0)); if (size > 1) { result = HashUtilities.hashCode(result, list.getStroke(size - 1)); if (size > 2) { result = HashUtilities.hashCode(result, list.getStroke(size / 2)); } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/HashUtilities.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/HashUtilities.java
Method name: `int hashCode(int, PaintList)` |  | Method name: `int hashCode(int, StrokeList)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    result = HashUtilities.hashCode(result, list.getPaint(0));↵

1

    result = HashUtilities.hashCode(result, list.getStroke(0));↵

2

                if (size > 1) {↵

2

                if (size > 1) {↵

3

                    result = HashUtilities.hashCode(result, ↵

3

                    result = HashUtilities.hashCode(result, ↵

4

                            list.getPaint(size - 1));↵

4

                            list.getStroke(size - 1));↵

5

                    if (size > 2) {↵

5

                    if (size > 2) {↵

6

                        result = HashUtilities.hashCode(result, ↵

6

                        result = HashUtilities.hashCode(result, ↵

7

                                list.getPaint(size / 2));↵

7

                                list.getStroke(size / 2));↵

8

                    }↵

8

                    }↵

9

                }

9

                }

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 declared in the same class
Number of node comparisons | 10

1. {Non-refactorable}

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

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

   7

       result = HashUtilities.hashCode(result, list.getStroke(0));

   7

       result = HashUtilities.hashCode(result, list.getPaint(0));

   8

       if (size > 1)

   8

       if (size > 1)

   9 | result = HashUtilities.hashCode(result, list.getStroke(size - 1));

   Preondition Violations
   Unmatched statement result=HashUtilities.hashCode(result,list.getStroke(size - 1)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   9

       result = HashUtilities.hashCode(result, list.getStroke(size - 1));

   9

       result = HashUtilities.hashCode(result, list.getPaint(size - 1));

   9 | result = HashUtilities.hashCode(result, list.getPaint(size - 1));

   Preondition Violations
   Unmatched statement result=HashUtilities.hashCode(result,list.getPaint(size - 1)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   10

       if (size > 2)

   10

       if (size > 2)

   11 | result = HashUtilities.hashCode(result, list.getStroke(size / 2));

   Preondition Violations
   Unmatched statement result=HashUtilities.hashCode(result,list.getStroke(size / 2)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   11

       result = HashUtilities.hashCode(result, list.getStroke(size / 2));

   11

       result = HashUtilities.hashCode(result, list.getPaint(size / 2));

   11 | result = HashUtilities.hashCode(result, list.getPaint(size / 2));

   Preondition Violations
   Unmatched statement result=HashUtilities.hashCode(result,list.getPaint(size / 2)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Unmatched statement result=HashUtilities.hashCode(result,list.getStroke(size - 1)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   2 | Unmatched statement result=HashUtilities.hashCode(result,list.getPaint(size - 1)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   3 | Unmatched statement result=HashUtilities.hashCode(result,list.getStroke(size / 2)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   4 | Unmatched statement result=HashUtilities.hashCode(result,list.getPaint(size / 2)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted