43-22-155

if (obj == this) { return true; } if (!(obj instanceof ColumnArrangement)) { return false; } ColumnArrangement that = (ColumnArrangement) obj; if (this.horizontalAlignment != that.horizontalAlignment) { return false; } if (this.verticalAlignment != that.verticalAlignment) { return false; } if (this.horizontalGap != that.horizontalGap) { return false; } if (this.verticalGap != that.verticalGap) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof CyclicNumberAxis)) { return false; } if (!super.equals(obj)) { return false; } CyclicNumberAxis that = (CyclicNumberAxis) obj; if (this.period != that.period) { return false; } if (this.offset != that.offset) { return false; } if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint)) { return false; } if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke)) { return false; } if (this.advanceLineVisible != that.advanceLineVisible) { return false; } if (this.boundMappedToLastCycle != that.boundMappedToLastCycle) { return false; } return true;

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

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;   ↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof ColumnArrangement↵

4

            if (!(obj instanceof CyclicNumberAxis)) {↵

5

                return false;↵

6

            }↵

5

    )) {↵

7

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

6

                return false;   ↵

8

                return false;↵

7

            }↵

9

            }↵

8

            ColumnArrangement that = (ColumnArrangement) obj;↵

10

            CyclicNumberAxis that = (CyclicNumberAxis) obj;      ↵

9

            if (this.horizontalAlignment != that.horizontalAlignme↵

11

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

12

                return false;↵

13

            }↵

14

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

15

                return false;↵

16

            }↵

17

            if (!PaintUtilities.equal(this.advanceLinePaint, ↵

10

    nt) {↵

18

                    that.advanceLinePaint)) {↵

11

                return false;↵

19

                return false;↵

12

            }↵

20

            }↵

13

            if (this.verticalAlignment != that.verticalAlignment↵

21

            if (!ObjectUtilities.equal(this.advanceLineStroke, ↵

14

    ) {↵

22

                    that.advanceLineStroke)) {↵

15

                return false;↵

23

                return false;↵

16

            }↵

24

            }↵

17

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

25

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

18

                return false;   ↵

26

                return false;↵

19

            }↵

27

            }↵

20

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

28

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

21

                return false;   ↵

29

                return false;↵

22

            }↵

30

            }↵

23

            return true;

31

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 8
   Number of unmapped statements in the first code fragment | 5
   Number of unmapped statements in the second code fragment | 3
   Time elapsed for statement mapping (ms) | 0.9
   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 ColumnArrangement))

   3 | if (!(obj instanceof ColumnArrangement))
   3 | if (!(obj instanceof CyclicNumberAxis))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.block.ColumnArrangement | org.jfree.chart.axis.CyclicNumberAxis | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof CyclicNumberAxis))

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

   6 | return false;

   Preondition Violations
   Unmatched return false;

   6

       return false;

   5

       ColumnArrangement that = (ColumnArrangement)obj;

   6

       if (this.horizontalAlignment != that.horizontalAlignment)

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   7

       CyclicNumberAxis that = (CyclicNumberAxis)obj;

   8

       if (this.verticalAlignment != that.verticalAlignment)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (this.horizontalGap != that.horizontalGap)

   10 | if (this.horizontalGap != that.horizontalGap)
   10 | if (this.offset != that.offset)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   horizontalGap | offset | VARIABLE_NAME_MISMATCH
   org.jfree.chart.block.ColumnArrangement | org.jfree.chart.axis.CyclicNumberAxis | VARIABLE_TYPE_MISMATCH
   horizontalGap | offset | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.block.ColumnArrangement of variable that does not match with type org.jfree.chart.axis.CyclicNumberAxis of variable that
   - Make classes org.jfree.chart.block.ColumnArrangement and org.jfree.chart.axis.CyclicNumberAxis extend a common superclass

   10

       if (this.offset != that.offset)

   11

       return false;

   11 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   12

       if (this.verticalGap != that.verticalGap)

   12 | if (this.verticalGap != that.verticalGap)
   8 | if (this.period != that.period)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   verticalGap | period | VARIABLE_NAME_MISMATCH
   org.jfree.chart.block.ColumnArrangement | org.jfree.chart.axis.CyclicNumberAxis | VARIABLE_TYPE_MISMATCH
   verticalGap | period | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.block.ColumnArrangement of variable that does not match with type org.jfree.chart.axis.CyclicNumberAxis of variable that
   - Make classes org.jfree.chart.block.ColumnArrangement and org.jfree.chart.axis.CyclicNumberAxis extend a common superclass

   8

       if (this.period != that.period)

   13

       return false;

   13 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   Precondition Violations (14)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof ColumnArrangement does not match with type boolean of variable obj instanceof CyclicNumberAxis
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Type org.jfree.chart.block.ColumnArrangement of variable that does not match with type org.jfree.chart.axis.CyclicNumberAxis of variable that
   6 | Type org.jfree.chart.block.ColumnArrangement of variable that does not match with type org.jfree.chart.axis.CyclicNumberAxis of variable that
   7 | Conditional return true;
   8 | Conditional return true;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;