43-12-53

if (obj == this) { return true; } if (!(obj instanceof OHLCDataItem)) { return false; } OHLCDataItem that = (OHLCDataItem) obj; if (!this.date.equals(that.date)) { return false; } if (!this.high.equals(that.high)) { return false; } if (!this.low.equals(that.low)) { return false; } if (!this.open.equals(that.open)) { return false; } if (!this.close.equals(that.close)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof AbstractXYItemLabelGenerator)) { return false; } AbstractXYItemLabelGenerator that = (AbstractXYItemLabelGenerator) obj; if (!this.formatString.equals(that.formatString)) { return false; } if (!ObjectUtilities.equal(this.xFormat, that.xFormat)) { return false; } if (!ObjectUtilities.equal(this.xDateFormat, that.xDateFormat)) { return false; } if (!ObjectUtilities.equal(this.yFormat, that.yFormat)) { return false; } if (!ObjectUtilities.equal(this.yDateFormat, that.yDateFormat)) { return false; } if (!this.nullYString.equals(that.nullYString)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/xy/OHLCDataItem.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/AbstractXYItemLabelGenerator.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | Number of AST nodes: 18

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;   ↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof OHLCDataItem)) {↵

4

            if (!(obj instanceof AbstractXYItemLabelGenerator)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            OHLCDataItem that = (OHLCDataItem) obj;↵

7

            AbstractXYItemLabelGenerator that = (AbstractXYItemLabelGenerator) obj;↵

8

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

8

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

9

                return false;   ↵

9

                return false;↵

10

            }↵

10

            }↵

11

            if (!this.high.equals(that.high↵

11

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

12

                return false;↵

13

            }↵

12

    )) {↵

14

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

13

                return false;↵

15

                return false;↵

14

            }↵

16

            }↵

15

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

17

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

16

                return false;   ↵

18

                return false;↵

17

            }↵

19

            }↵

18

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

20

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

19

                return false;   ↵

21

                return false;↵

20

            }↵

22

            }↵

21

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

23

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

22

                return false;   ↵

24

            	return false;↵

23

            }↵

25

            }↵

24

            return true;

26

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 8
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 9
   Time elapsed for statement mapping (ms) | 1.0
   Clone type | Type 3

   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 OHLCDataItem))

   3 | if (!(obj instanceof OHLCDataItem))
   3 | if (!(obj instanceof AbstractXYItemLabelGenerator))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.OHLCDataItem | org.jfree.chart.labels.AbstractXYItemLabelGenerator | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof OHLCDataItem does not match with type boolean of variable obj instanceof AbstractXYItemLabelGenerator
   - Make classes org.jfree.data.xy.OHLCDataItem and org.jfree.chart.labels.AbstractXYItemLabelGenerator extend a common superclass

   3

       if (!(obj instanceof AbstractXYItemLabelGenerator))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       AbstractXYItemLabelGenerator that = (AbstractXYItemLabelGenerator)obj;

   5

       OHLCDataItem that = (OHLCDataItem)obj;

   6

       if (!this.date.equals(that.date))

   6 | if (! this.date.equals(that.date))
   6 | if (! this.formatString.equals(that.formatString))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.OHLCDataItem | org.jfree.chart.labels.AbstractXYItemLabelGenerator | VARIABLE_TYPE_MISMATCH
   date | formatString | VARIABLE_NAME_MISMATCH
   java.util.Date | java.lang.String | VARIABLE_TYPE_MISMATCH
   date | formatString | VARIABLE_NAME_MISMATCH
   java.util.Date | java.lang.String | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.xy.OHLCDataItem of variable that does not match with type org.jfree.chart.labels.AbstractXYItemLabelGenerator of variable that
   - Make classes org.jfree.data.xy.OHLCDataItem and org.jfree.chart.labels.AbstractXYItemLabelGenerator extend a common superclass

   Type java.util.Date of variable that.date does not match with type java.lang.String of variable that.formatString
   - Make classes java.util.Date and java.lang.String extend a common superclass

   Type java.util.Date of variable this.date does not match with type java.lang.String of variable this.formatString
   - Make classes java.util.Date and java.lang.String extend a common superclass

   6

       if (!this.formatString.equals(that.formatString))

   7

       return false;

   7 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   8

       if (!ObjectUtilities.equal(this.xFormat, that.xFormat))

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   10

       if (!ObjectUtilities.equal(this.xDateFormat, that.xDateFormat))

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   12

       if (!ObjectUtilities.equal(this.yFormat, that.yFormat))

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   14

       if (!ObjectUtilities.equal(this.yDateFormat, that.yDateFormat))

   15 | return false;

   Preondition Violations
   Unmatched return false;

   15

       return false;

   8

       if (!this.high.equals(that.high))

   8 | if (! this.high.equals(that.high))
   16 | if (! this.nullYString.equals(that.nullYString))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.OHLCDataItem | org.jfree.chart.labels.AbstractXYItemLabelGenerator | VARIABLE_TYPE_MISMATCH
   high | nullYString | VARIABLE_NAME_MISMATCH
   java.lang.Number | java.lang.String | VARIABLE_TYPE_MISMATCH
   high | nullYString | VARIABLE_NAME_MISMATCH
   java.lang.Number | java.lang.String | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.xy.OHLCDataItem of variable that does not match with type org.jfree.chart.labels.AbstractXYItemLabelGenerator of variable that
   - Make classes org.jfree.data.xy.OHLCDataItem and org.jfree.chart.labels.AbstractXYItemLabelGenerator extend a common superclass

   Type java.lang.Number of variable that.high does not match with type java.lang.String of variable that.nullYString
   - Make classes java.lang.Number and java.lang.String extend a common superclass

   Type java.lang.Number of variable this.high does not match with type java.lang.String of variable this.nullYString
   - Make classes java.lang.Number and java.lang.String extend a common superclass

   16

       if (!this.nullYString.equals(that.nullYString))

   9

       return false;

   9 | return false;
   17 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   17

       return false;

   Precondition Violations (19)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof OHLCDataItem does not match with type boolean of variable obj instanceof AbstractXYItemLabelGenerator
   2 | Type org.jfree.data.xy.OHLCDataItem of variable that does not match with type org.jfree.chart.labels.AbstractXYItemLabelGenerator of variable that
   3 | Type java.util.Date of variable that.date does not match with type java.lang.String of variable that.formatString
   4 | Type java.util.Date of variable this.date does not match with type java.lang.String of variable this.formatString
   5 | Unmatched return false;
   6 | Unmatched return false;
   7 | Unmatched return false;
   8 | Unmatched return false;
   9 | Type org.jfree.data.xy.OHLCDataItem of variable that does not match with type org.jfree.chart.labels.AbstractXYItemLabelGenerator of variable that
   10 | Type java.lang.Number of variable that.high does not match with type java.lang.String of variable that.nullYString
   11 | Type java.lang.Number of variable this.high does not match with type java.lang.String of variable this.nullYString
   12 | Conditional return true;
   13 | Conditional return true;
   14 | Conditional return false;
   15 | Conditional return false;
   16 | Conditional return false;
   17 | Conditional return false;
   18 | Conditional return false;
   19 | Conditional return false;