291-1-2

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

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: 7 |  | Number of AST nodes: 7

1

    boolean result = this.baseSeriesVisible;↵

1

    boolean result = this.baseSeriesVisibleInLegend;↵

2

            if (this.seriesVisible != null) {↵

2

            if (this.seriesVisibleInLegend != null) {↵

3

                result = this.seriesVisible.booleanValue();↵

3

                result = this.seriesVisibleInLegend.booleanValue();↵

4

            }↵

4

            }↵

5

            else {↵

5

            else {↵

6

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

6

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

7

                if (b != null) {↵

7

                if (b != null) {↵

8

                    result = b.booleanValue();↵

8

                    result = b.booleanValue();↵

9

                }↵

9

                }↵

10

            }↵

10

            }↵

11

            return result;

11

            return result;

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 declared in the same class
Number of node comparisons | 17

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 7
   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 result = this.baseSeriesVisible;

   1 | boolean result = this.baseSeriesVisible;
   1 | boolean result = this.baseSeriesVisibleInLegend;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   baseSeriesVisible | baseSeriesVisibleInLegend | VARIABLE_NAME_MISMATCH

   1

       boolean result = this.baseSeriesVisibleInLegend;

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

   7

       return result;

   7

       return result;

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