43-141-144

if (obj == this) { return true; } if (!(obj instanceof CombinedRangeXYPlot)) { return false; } if (!super.equals(obj)) { return false; } CombinedRangeXYPlot that = (CombinedRangeXYPlot) obj; if (!ObjectUtilities.equal(this.subplots, that.subplots)) { return false; } if (this.totalWeight != that.totalWeight) { return false; } if (this.gap != that.gap) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof MonthDateFormat)) { return false; } if (!super.equals(obj)) { return false; } MonthDateFormat that = (MonthDateFormat) obj; if (!Arrays.equals(this.months, that.months)) { return false; } if (!Arrays.equals(this.showYear, that.showYear)) { return false; } if (!this.yearFormatter.equals(that.yearFormatter)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeXYPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/MonthDateFormat.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | Number of AST nodes: 14

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof CombinedRangeXYPlot)) {↵

4

            if (!(obj instanceof MonthDateFormat)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            if (!super.equals(obj)) {↵

7

            if (!super.equals(obj)) {↵

8

                return false;↵

8

                return false;↵

9

            }↵

9

            }↵

10

            CombinedRangeXYPlot that = (CombinedRangeXYPlot) obj;↵

10

            MonthDateFormat that = (MonthDateFormat) obj;↵

11

            if (!ObjectUtilities.equal(this.subplots, that.subplots)) {↵

11

            if (!Arrays.equals(this.months, that.months)) {↵

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

            if (this.totalWeight != that.totalWeight) {↵

14

            if (!Arrays.equals(this.showYear, that.showYear)) {↵

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

            if (this.gap != that.gap) {↵

17

            if (!this.yearFormatter.equals(that.yearFormatter)) {↵

18

                return false;↵

18

                return false;↵

19

            }↵

19

            }↵

20

            return true;

20

            return true;

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) | 1.3
Clones location | Clones are in different classes
Number of node comparisons | 54

1. {Non-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) | 0.4
   Clone type | Type 2

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

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2 | return true;
   2 | return true;

   Preondition Violations
   Conditional return true;
   Conditional return true;

   2

       return true;

   3

       if (!(obj instanceof CombinedRangeXYPlot))

   3 | if (!(obj instanceof CombinedRangeXYPlot))
   3 | if (!(obj instanceof MonthDateFormat))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CombinedRangeXYPlot | org.jfree.chart.axis.MonthDateFormat | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof CombinedRangeXYPlot does not match with type boolean of variable obj instanceof MonthDateFormat
   - Make classes org.jfree.chart.plot.CombinedRangeXYPlot and org.jfree.chart.axis.MonthDateFormat extend a common superclass

   3

       if (!(obj instanceof MonthDateFormat))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       if (!super.equals(obj))

   5

       if (!super.equals(obj))

   6

       return false;

   6 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   Precondition Violations (7)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof CombinedRangeXYPlot does not match with type boolean of variable obj instanceof MonthDateFormat
   2 | Conditional return true;
   3 | Conditional return true;
   4 | Conditional return false;
   5 | Conditional return false;
   6 | Conditional return false;
   7 | Conditional return false;