399-5-6

if (this.negativeItemLabelPosition != null) { return this.negativeItemLabelPosition; } // otherwise look up the position list ItemLabelPosition position = (ItemLabelPosition) this.negativeItemLabelPositionList.get(series); if (position == null) { position = this.baseNegativeItemLabelPosition; } return position;
if (this.positiveItemLabelPosition != null) { return this.positiveItemLabelPosition; } // otherwise look up the position table ItemLabelPosition position = (ItemLabelPosition) this.positiveItemLabelPositionList.get(series); if (position == null) { position = this.basePositiveItemLabelPosition; } return position;

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: `ItemLabelPosition getSeriesNegativeItemLabelPosition(int)` |  | Method name: `ItemLabelPosition getSeriesPositiveItemLabelPosition(int)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    if (this.negativeItemLabelPosition != null) {↵

1

    if (this.positiveItemLabelPosition != null) {↵

2

                return this.negativeItemLabelPosition;↵

2

                return this.positiveItemLabelPosition;↵

3

            }↵

3

            }↵

4

            // otherwise look up the position list↵

4

            // otherwise look up the position table↵

5

            ItemLabelPosition position = (ItemLabelPosition)↵

5

            ItemLabelPosition position = (ItemLabelPosition)↵

6

                this.negativeItemLabelPositionList.get(series);↵

6

                this.positiveItemLabelPositionList.get(series);↵

7

            if (position == null) {↵

7

            if (position == null) {↵

8

                position = this.baseNegativeItemLabelPosition;↵

8

                position = this.basePositiveItemLabelPosition;↵

9

            }↵

9

            }↵

10

            return position;

10

            return position;

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

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.0
   Clone type | Type 2

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

   1

       if (this.negativeItemLabelPosition != null)

   1 | if (this.negativeItemLabelPosition != null)
   1 | if (this.positiveItemLabelPosition != null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   negativeItemLabelPosition | positiveItemLabelPosition | VARIABLE_NAME_MISMATCH

   1

       if (this.positiveItemLabelPosition != null)

   2

       return this.negativeItemLabelPosition;

   2 | return this.negativeItemLabelPosition;
   2 | return this.positiveItemLabelPosition;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   negativeItemLabelPosition | positiveItemLabelPosition | VARIABLE_NAME_MISMATCH

   2

       return this.positiveItemLabelPosition;

   3

       ItemLabelPosition position = (ItemLabelPosition)this.negativeItemLabelPositionList.get(series);

   3 | ItemLabelPosition position = (ItemLabelPosition)this.negativeItemLabelPositionList.get(series);
   3 | ItemLabelPosition position = (ItemLabelPosition)this.positiveItemLabelPositionList.get(series);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   negativeItemLabelPositionList | positiveItemLabelPositionList | VARIABLE_NAME_MISMATCH

   3

       ItemLabelPosition position = (ItemLabelPosition)this.positiveItemLabelPositionList.get(series);

   4

       if (position == null)

   4

       if (position == null)

   5

       position = this.baseNegativeItemLabelPosition;

   5 | position = this.baseNegativeItemLabelPosition;
   5 | position = this.basePositiveItemLabelPosition;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   baseNegativeItemLabelPosition | basePositiveItemLabelPosition | VARIABLE_NAME_MISMATCH

   5

       position = this.basePositiveItemLabelPosition;

   6

       return position;

   6

       return position;

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