178-2-3

if (this.fillPaint != null) { return this.fillPaint; } // otherwise look up the paint table Paint seriesFillPaint = getSeriesFillPaint(series); if (seriesFillPaint == null && this.autoPopulateSeriesFillPaint) { DrawingSupplier supplier = getDrawingSupplier(); if (supplier != null) { seriesFillPaint = supplier.getNextFillPaint(); setSeriesFillPaint(series, seriesFillPaint, false); } } if (seriesFillPaint == null) { seriesFillPaint = this.baseFillPaint; } return seriesFillPaint;
if (this.outlinePaint != null) { return this.outlinePaint; } // otherwise look up the paint table Paint seriesOutlinePaint = getSeriesOutlinePaint(series); if (seriesOutlinePaint == null && this.autoPopulateSeriesOutlinePaint) { DrawingSupplier supplier = getDrawingSupplier(); if (supplier != null) { seriesOutlinePaint = supplier.getNextOutlinePaint(); setSeriesOutlinePaint(series, seriesOutlinePaint, false); } } if (seriesOutlinePaint == null) { seriesOutlinePaint = this.baseOutlinePaint; } return seriesOutlinePaint;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/AbstractRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/AbstractRenderer.java
Method name: `Paint lookupSeriesFillPaint(int)` |  | Method name: `Paint lookupSeriesOutlinePaint(int)`
Number of AST nodes: 11 |  | Number of AST nodes: 11

1

    if (this.fillPaint != null) {↵

1

    if (this.outlinePaint != null) {↵

2

                return this.fillPaint;↵

2

                return this.outlinePaint;↵

3

            }↵

3

            }↵

4

            // otherwise look up the paint table↵

4

            // otherwise look up the paint table↵

5

            Paint seriesFillPaint = getSeriesFillPaint(series);↵

5

            Paint seriesOutlinePaint = getSeriesOutlinePaint(series);↵

6

            if (seriesFillPaint == null && this.autoPopulateSeriesFillPaint) {↵

6

            if (seriesOutlinePaint == null && this.autoPopulateSeriesOutlinePaint) {↵

7

                DrawingSupplier supplier = getDrawingSupplier();↵

7

                DrawingSupplier supplier = getDrawingSupplier();↵

8

                if (supplier != null) {↵

8

                if (supplier != null) {↵

9

                    seriesFillPaint = supplier.getNextFillPaint();↵

9

                    seriesOutlinePaint = supplier.getNextOutlinePaint();↵

10

                    setSeriesFillPaint(series, seriesFillPaint, false);↵

10

                    setSeriesOutlinePaint(series, seriesOutlinePaint, false);↵

11

                }↵

11

                }↵

12

            }↵

12

            }↵

13

            if (seriesFillPaint == null) {↵

13

            if (seriesOutlinePaint == null) {↵

14

                seriesFillPaint = this.baseFillPaint;↵

14

                seriesOutlinePaint = this.baseOutlinePaint;↵

15

            }↵

15

            }↵

16

            return seriesFillPaint;

16

            return seriesOutlinePaint;

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.4
Clones location | Clones are declared in the same class
Number of node comparisons | 30

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 11
   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) | 2.8
   Clone type | Type 2

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

   1

       if (this.fillPaint != null)

   1 | if (this.fillPaint != null)
   1 | if (this.outlinePaint != null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   fillPaint | outlinePaint | VARIABLE_NAME_MISMATCH

   1

       if (this.outlinePaint != null)

   2

       return this.fillPaint;

   2 | return this.fillPaint;
   2 | return this.outlinePaint;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   fillPaint | outlinePaint | VARIABLE_NAME_MISMATCH

   2

       return this.outlinePaint;

   3

       Paint seriesFillPaint = getSeriesFillPaint(series);

   3 | Paint seriesFillPaint = getSeriesFillPaint(series);
   3 | Paint seriesOutlinePaint = getSeriesOutlinePaint(series);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesFillPaint | seriesOutlinePaint | VARIABLE_NAME_MISMATCH
   getSeriesFillPaint | getSeriesOutlinePaint | METHOD_INVOCATION_NAME_MISMATCH

   3

       Paint seriesOutlinePaint = getSeriesOutlinePaint(series);

   4

       if (seriesFillPaint == null && this.autoPopulateSeriesFillPaint)

   4 | if (seriesFillPaint == null && this.autoPopulateSeriesFillPaint)
   4 | if (seriesOutlinePaint == null && this.autoPopulateSeriesOutlinePaint)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesFillPaint | seriesOutlinePaint | VARIABLE_NAME_MISMATCH
   autoPopulateSeriesFillPaint | autoPopulateSeriesOutlinePaint | VARIABLE_NAME_MISMATCH

   4

       if (seriesOutlinePaint == null && this.autoPopulateSeriesOutlinePaint)

   5

       DrawingSupplier supplier = getDrawingSupplier();

   5

       DrawingSupplier supplier = getDrawingSupplier();

   6

       if (supplier != null)

   6

       if (supplier != null)

   7

       seriesFillPaint = supplier.getNextFillPaint();

   7 | seriesFillPaint = supplier.getNextFillPaint();
   7 | seriesOutlinePaint = supplier.getNextOutlinePaint();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesFillPaint | seriesOutlinePaint | VARIABLE_NAME_MISMATCH
   getNextFillPaint | getNextOutlinePaint | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression supplier.getNextFillPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression supplier.getNextOutlinePaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted

   7

       seriesOutlinePaint = supplier.getNextOutlinePaint();

   8

       setSeriesFillPaint(series, seriesFillPaint, false);

   8 | setSeriesFillPaint(series, seriesFillPaint, false);
   8 | setSeriesOutlinePaint(series, seriesOutlinePaint, false);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   setSeriesFillPaint | setSeriesOutlinePaint | METHOD_INVOCATION_NAME_MISMATCH
   seriesFillPaint | seriesOutlinePaint | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression setSeriesFillPaint(series,seriesFillPaint,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression setSeriesOutlinePaint(series,seriesOutlinePaint,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression setSeriesFillPaint(series,seriesFillPaint,false) is a void method call, and thus it cannot be parameterized
   Expression setSeriesOutlinePaint(series,seriesOutlinePaint,false) is a void method call, and thus it cannot be parameterized

   8

       setSeriesOutlinePaint(series, seriesOutlinePaint, false);

   9

       if (seriesFillPaint == null)

   9 | if (seriesFillPaint == null)
   9 | if (seriesOutlinePaint == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesFillPaint | seriesOutlinePaint | VARIABLE_NAME_MISMATCH

   9

       if (seriesOutlinePaint == null)

   10

       seriesFillPaint = this.baseFillPaint;

   10 | seriesFillPaint = this.baseFillPaint;
   10 | seriesOutlinePaint = this.baseOutlinePaint;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesFillPaint | seriesOutlinePaint | VARIABLE_NAME_MISMATCH
   baseFillPaint | baseOutlinePaint | VARIABLE_NAME_MISMATCH

   10

       seriesOutlinePaint = this.baseOutlinePaint;

   11

       return seriesFillPaint;

   11 | return seriesFillPaint;
   11 | return seriesOutlinePaint;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesFillPaint | seriesOutlinePaint | VARIABLE_NAME_MISMATCH

   11

       return seriesOutlinePaint;

   Precondition Violations (6)
   Row | Violation
   --- | ---
   1 | Expression supplier.getNextFillPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression supplier.getNextOutlinePaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression setSeriesFillPaint(series,seriesFillPaint,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression setSeriesOutlinePaint(series,seriesOutlinePaint,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression setSeriesFillPaint(series,seriesFillPaint,false) is a void method call, and thus it cannot be parameterized
   6 | Expression setSeriesOutlinePaint(series,seriesOutlinePaint,false) is a void method call, and thus it cannot be parameterized