308-5-6

if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof WaterfallBarRenderer)) { return false; } WaterfallBarRenderer that = (WaterfallBarRenderer) obj; if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) { return false; } if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) { return false; } if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint)) { return false; } if (!PaintUtilities.equal(this.negativeBarPaint, that.negativeBarPaint)) { return false; } return true;
if (this == obj) { return true; } if (!(obj instanceof HighLowRenderer)) { return false; } HighLowRenderer that = (HighLowRenderer) obj; if (this.drawOpenTicks != that.drawOpenTicks) { return false; } if (this.drawCloseTicks != that.drawCloseTicks) { return false; } if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint)) { return false; } if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint)) { return false; } if (this.tickLength != that.tickLength) { return false; } if (!super.equals(obj)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/WaterfallBarRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/HighLowRenderer.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 (this == obj) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

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

4

            if (!(obj instanceof HighLowRenderer)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            if (!(obj instanceof WaterfallBarRenderer)) {↵

7

            ↵

8

                return false;↵

9

            }↵

10

            WaterfallBarRenderer that = (WaterfallBarRenderer) obj;↵

8

    HighLowRenderer that = (HighLowRenderer) obj;↵

9

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

10

                return false;↵

11

            }↵

12

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

13

                return false;↵

14

            }↵

11

            if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) {↵

15

            if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint)) {↵

12

                return false;↵

16

                return false;↵

13

            }↵

17

            }↵

14

            if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) {↵

18

            if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint)) {↵

15

                return false;↵

19

                return false;↵

16

            }↵

20

            }↵

17

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

21

            if (↵

18

                    that.positiveBarPaint)) {↵

22

    this.tickLength != that.tickLength) {↵

19

                return false;↵

23

                return false;↵

20

            }↵

24

            }↵

21

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

25

            if (!↵

22

                    that.negativeBarPaint)) {↵

26

    super.equals(obj)) {↵

23

                return false;↵

27

                return false;↵

24

            }↵

28

            }↵

25

            return true;

29

            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.6
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 87

1. {Non-refactorable}

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

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

   3

       if (!super.equals(obj))

   16

       if (!super.equals(obj))

   4

       return false;

   4 | return false;
   17 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   17

       return false;

   5

       if (!(obj instanceof WaterfallBarRenderer))

   5 | if (!(obj instanceof WaterfallBarRenderer))
   3 | if (!(obj instanceof HighLowRenderer))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.WaterfallBarRenderer | org.jfree.chart.renderer.xy.HighLowRenderer | SUBCLASS_TYPE_MISMATCH

   3

       if (!(obj instanceof HighLowRenderer))

   6

       return false;

   6 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   7

       WaterfallBarRenderer that = (WaterfallBarRenderer)obj;

   7 | WaterfallBarRenderer that = (WaterfallBarRenderer)obj;
   5 | HighLowRenderer that = (HighLowRenderer)obj;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.WaterfallBarRenderer | org.jfree.chart.renderer.xy.HighLowRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.WaterfallBarRenderer | org.jfree.chart.renderer.xy.HighLowRenderer | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.WaterfallBarRenderer | org.jfree.chart.renderer.xy.HighLowRenderer | SUBCLASS_TYPE_MISMATCH

   5

       HighLowRenderer that = (HighLowRenderer)obj;

   6

       if (this.drawOpenTicks != that.drawOpenTicks)

   7 | return false;

   Preondition Violations
   Unmatched return false;

   7

       return false;

   8

       if (this.drawCloseTicks != that.drawCloseTicks)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   8

       if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint))

   8 | if (! PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint))
   10 | if (! PaintUtilities.equal(this.openTickPaint, that.openTickPaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   firstBarPaint | openTickPaint | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.WaterfallBarRenderer | org.jfree.chart.renderer.xy.HighLowRenderer | SUBCLASS_TYPE_MISMATCH
   firstBarPaint | openTickPaint | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression that.firstBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression that.openTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted

   10

       if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint))

   9

       return false;

   9 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   10

       if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint))

   10 | if (! PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint))
   12 | if (! PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   lastBarPaint | closeTickPaint | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.WaterfallBarRenderer | org.jfree.chart.renderer.xy.HighLowRenderer | SUBCLASS_TYPE_MISMATCH
   lastBarPaint | closeTickPaint | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression that.lastBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression that.closeTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted

   12

       if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint))

   11

       return false;

   11 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   14

       if (this.tickLength != that.tickLength)

   15 | return false;

   Preondition Violations
   Unmatched return false;

   15

       return false;

   Precondition Violations (16)
   Row | Violation
   --- | ---
   1 | Unmatched return false;
   2 | Unmatched return false;
   3 | Expression that.firstBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression that.openTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression that.lastBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Expression that.closeTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Unmatched return false;
   8 | Clone fragment #1 returns variable that with type org.jfree.chart.renderer.category.WaterfallBarRenderer , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.xy.HighLowRenderer
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;
   15 | Conditional return false;
   16 | Conditional return false;