1117-1-2

String u1 = getURL(series, item); String u2 = generator.getURL(series, item); if (u1 != null) { if (!u1.equals(u2)) { return false; } } else { if (u2 != null) { return false; } }
String u1 = getURL(series, item); String u2 = that.getURL(series, item); if (u1 != null) { if (!u1.equals(u2)) { return false; } } else { if (u2 != null) { return false; } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/urls/CustomCategoryURLGenerator.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/urls/CustomXYURLGenerator.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    String u1 = getURL(series, item);↵

1

    String u1 = getURL(series, item);↵

2

                    String u2 = generator.getURL(series, item);↵

2

                    String u2 = that.getURL(series, item);↵

3

                    if (u1 != null) {↵

3

                    if (u1 != null) {↵

4

                        if (!u1.equals(u2)) {↵

4

                        if (!u1.equals(u2)) {↵

5

                            return false;↵

5

                            return false;↵

6

                        }↵

6

                        }↵

7

                    }↵

7

                    }↵

8

     else {↵

8

                    else {↵

9

                        if (u2 != null) {↵

9

                        if (u2 != null) {↵

10

                            return false;↵

10

                            return false;↵

11

                        }↵

11

                        }↵

12

                    }

12

                    }

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

1. {Non-refactorable}

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

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

   14

       String u1 = getURL(series, item);

   14

       String u1 = getURL(series, item);

   15

       String u2 = generator.getURL(series, item);

   15 | String u2 = generator.getURL(series, item);
   15 | String u2 = that.getURL(series, item);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   generator | that | VARIABLE_NAME_MISMATCH
   org.jfree.chart.urls.CustomCategoryURLGenerator | org.jfree.chart.urls.CustomXYURLGenerator | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.urls.CustomCategoryURLGenerator of variable generator does not match with type org.jfree.chart.urls.CustomXYURLGenerator of variable that
   - Make classes org.jfree.chart.urls.CustomCategoryURLGenerator and org.jfree.chart.urls.CustomXYURLGenerator extend a common superclass

   15

       String u2 = that.getURL(series, item);

   16

       if (u1 != null)

   16

       if (u1 != null)

   17

       if (!u1.equals(u2))

   17

       if (!u1.equals(u2))

   18

       return false;

   18 | return false;
   18 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   18

       return false;

       else

       else

   19

       if (u2 != null)

   19

       if (u2 != null)

   20

       return false;

   20 | return false;
   20 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   20

       return false;

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type org.jfree.chart.urls.CustomCategoryURLGenerator of variable generator does not match with type org.jfree.chart.urls.CustomXYURLGenerator of variable that
   2 | Conditional return false;
   3 | Conditional return false;
   4 | Conditional return false;
   5 | Conditional return false;