1022-3-5

for (int c = 0; c < colCount; c++) { Number v1 = getValue(r, c); Number v2 = kv2D.getValue(r, c); if (v1 == null) { if (v2 != null) { return false; } } else { if (!v1.equals(v2)) { return false; } } }
for (int c = 0; c < colCount; c++) { Number v1 = getValue(r, c); Number v2 = that.getValue(r, c); if (v1 == null) { if (v2 != null) { return false; } } else if (!v1.equals(v2)) { return false; } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/DefaultKeyedValues2D.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/category/DefaultCategoryDataset.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 8 |  | Number of AST nodes: 8

1

    for (int c = 0; c < colCount; c++) {↵

1

    for (int c = 0; c < colCount; c++) {↵

2

                    Number v1 = getValue(r, c);↵

2

                    Number v1 = getValue(r, c);↵

3

                    Number v2 = kv2D.getValue(r, c);↵

3

                    Number v2 = that.getValue(r, c);↵

4

                    if (v1 == null) {↵

4

                    if (v1 == null) {↵

5

                        if (v2 != null) {↵

5

                        if (v2 != null) {↵

6

                            return false;↵

6

                            return false;↵

7

                        }↵

7

                        }↵

8

                    }↵

8

                    }↵

9

                    else {↵

9

                    else ↵

10

                        if (!v1.equals(v2)) {↵

10

    if (!v1.equals(v2)) {↵

11

                            return false;↵

11

                        return false;↵

12

                        }↵

13

                    }↵

12

                    }↵

14

                }

13

                }

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

1. {Non-refactorable}

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

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

   23

       if (v2 != null)

   17

       if (v2 != null)

   24

       return false;

   24 | return false;
   18 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   18

       return false;

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Conditional return false;
   2 | Conditional return false;