324-3-5

Boolean flag = this.shapesFilled; if (flag == null) { flag = getSeriesShapesFilled(series); } if (flag != null) { return flag.booleanValue(); } else { return this.baseShapesFilled; }
Boolean flag = this.shapesVisible; if (flag == null) { flag = getSeriesShapesVisible(series); } if (flag != null) { return flag.booleanValue(); } else { return this.baseShapesVisible; }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LineAndShapeRenderer.java
Method name: `boolean getItemShapeFilled(int, int)` |  | Method name: `boolean getItemShapeVisible(int, int)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    Boolean flag = this.shapesFilled;↵

1

    Boolean flag = this.shapesVisible;↵

2

            if (flag == null) {↵

2

            if (flag == null) {↵

3

                flag = getSeriesShapesFilled(series);↵

3

                flag = getSeriesShapesVisible(series);↵

4

            }↵

4

            }↵

5

            if (flag != null) {↵

5

            if (flag != null) {↵

6

                return flag.booleanValue();↵

6

                return flag.booleanValue();↵

7

            }↵

7

            }↵

8

            else {↵

8

            else {↵

9

                return this.baseShapesFilled;↵

9

                return this.baseShapesVisible;↵

10

            }

10

            }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 21

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

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

   1

       Boolean flag = this.shapesFilled;

   1 | Boolean flag = this.shapesFilled;
   1 | Boolean flag = this.shapesVisible;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   shapesFilled | shapesVisible | VARIABLE_NAME_MISMATCH

   1

       Boolean flag = this.shapesVisible;

   2

       if (flag == null)

   2

       if (flag == null)

   3

       flag = getSeriesShapesFilled(series);

   3 | flag = getSeriesShapesFilled(series);
   3 | flag = getSeriesShapesVisible(series);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getSeriesShapesFilled | getSeriesShapesVisible | METHOD_INVOCATION_NAME_MISMATCH

   3

       flag = getSeriesShapesVisible(series);

   4

       if (flag != null)

   4

       if (flag != null)

   5

       return flag.booleanValue();

   5

       return flag.booleanValue();

       else

       else

   6

       return this.baseShapesFilled;

   6 | return this.baseShapesFilled;
   6 | return this.baseShapesVisible;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   baseShapesFilled | baseShapesVisible | VARIABLE_NAME_MISMATCH

   6

       return this.baseShapesVisible;

   Precondition Violations (0)
   Row | Violation
   --- | ---