423-1-2

if (value >= uclip) { value = uclip; } else { if (value <= lclip) { value = lclip; } }
if (value >= uclip) { value = uclip; } else { if (value <= lclip) { value = lclip; } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StatisticalBarRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LayeredBarRenderer.java
Method name: `void drawHorizontalItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, StatisticalCategoryDataset, int, int)` |  | Method name: `void drawVerticalItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int)`
Number of AST nodes: 4 |  | Number of AST nodes: 4

1

    if (value >= uclip) {↵

1

    if (value >= uclip) {↵

2

                    value = uclip;↵

2

                    value = uclip;↵

3

                }↵

3

                }↵

4

                else {↵

4

                else {↵

5

                    if (value <= lclip) {↵

5

                    if (value <= lclip) {↵

6

                        value = lclip;↵

6

                        value = lclip;↵

7

                    }↵

7

                    }↵

8

                }

8

                }

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 | 9

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 4
   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) | 0.6
   Clone type | Type 1

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

   23

       if (value >= uclip)

   17

       if (value >= uclip)

   24

       value = uclip;

   18

       value = uclip;

       else

       else

   25

       if (value <= lclip)

   19

       if (value <= lclip)

   26

       value = lclip;

   20

       value = lclip;

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