1605-1-2

if (this.seriesVisible != null) { result = this.seriesVisible.booleanValue(); } else { Boolean b = this.seriesVisibleList.getBoolean(series); if (b != null) { result = b.booleanValue(); } }
if (this.seriesVisibleInLegend != null) { result = this.seriesVisibleInLegend.booleanValue(); } else { Boolean b = this.seriesVisibleInLegendList.getBoolean(series); if (b != null) { result = b.booleanValue(); } }

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: `boolean isSeriesVisible(int)` |  | Method name: `boolean isSeriesVisibleInLegend(int)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    if (this.seriesVisible != null) {↵

1

    if (this.seriesVisibleInLegend != null) {↵

2

                result = this.seriesVisible.booleanValue();↵

2

                result = this.seriesVisibleInLegend.booleanValue();↵

3

            }↵

3

            }↵

4

            else {↵

4

            else {↵

5

                Boolean b = this.seriesVisibleList.getBoolean(series);↵

5

                Boolean b = this.seriesVisibleInLegendList.getBoolean(series);↵

6

                if (b != null) {↵

6

                if (b != null) {↵

7

                    result = b.booleanValue();↵

7

                    result = b.booleanValue();↵

8

                }↵

8

                }↵

9

            }

9

            }

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

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 5
   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.8
   Clone type | Type 2

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

   2

       if (this.seriesVisible != null)

   2 | if (this.seriesVisible != null)
   2 | if (this.seriesVisibleInLegend != null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesVisible | seriesVisibleInLegend | VARIABLE_NAME_MISMATCH

   2

       if (this.seriesVisibleInLegend != null)

   3

       result = this.seriesVisible.booleanValue();

   3 | result = this.seriesVisible.booleanValue();
   3 | result = this.seriesVisibleInLegend.booleanValue();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesVisible | seriesVisibleInLegend | VARIABLE_NAME_MISMATCH

   3

       result = this.seriesVisibleInLegend.booleanValue();

       else

       else

   4

       Boolean b = this.seriesVisibleList.getBoolean(series);

   4 | Boolean b = this.seriesVisibleList.getBoolean(series);
   4 | Boolean b = this.seriesVisibleInLegendList.getBoolean(series);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seriesVisibleList | seriesVisibleInLegendList | VARIABLE_NAME_MISMATCH

   4

       Boolean b = this.seriesVisibleInLegendList.getBoolean(series);

   5

       if (b != null)

   5

       if (b != null)

   6

       result = b.booleanValue();

   6

       result = b.booleanValue();

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