327-1-3

if (uclip <= 0.0) { // cases 1, 2, 3 and 4 if (value >= uclip) { return; // bar is not visible } base = uclip; if (value <= lclip) { value = lclip; } } else if (lclip <= 0.0) { // cases 5, 6, 7 and 8 if (value >= uclip) { value = uclip; } else { if (value <= lclip) { value = lclip; } } } else { // cases 9, 10, 11 and 12 if (value <= lclip) { return; // bar is not visible } base = lclip; if (value >= uclip) { value = uclip; } }
if (uclip <= 0.0) { // cases 1, 2, 3 and 4 if (value >= uclip) { return; // bar is not visible } base = uclip; if (value <= lclip) { value = lclip; } } else if (lclip <= 0.0) { // cases 5, 6, 7 and 8 if (value >= uclip) { value = uclip; } else { if (value <= lclip) { value = lclip; } } } else { // cases 9, 10, 11 and 12 if (value <= lclip) { return; // bar is not visible } base = getLowerClip(); if (value >= uclip) { value = uclip; } }

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

1

    if (uclip <= 0.0) {  // cases 1, 2, 3 and 4↵

1

    if (uclip <= 0.0) {  // cases 1, 2, 3 and 4↵

2

                if (value >= uclip) {↵

2

                if (value >= uclip) {↵

3

                    return; // bar is not visible↵

3

                    return; // bar is not visible↵

4

                }↵

4

                }↵

5

                base = uclip;↵

5

                base = uclip;↵

6

                if (value <= lclip) {↵

6

                if (value <= lclip) {↵

7

                    value = lclip;↵

7

                    value = lclip;↵

8

                }↵

8

                }↵

9

            }↵

9

            }↵

10

            else if (lclip <= 0.0) { // cases 5, 6, 7 and 8↵

10

            else if (lclip <= 0.0) { // cases 5, 6, 7 and 8↵

11

                if (value >= uclip) {↵

11

                if (value >= uclip) {↵

12

                    value = uclip;↵

12

                    value = uclip;↵

13

                }↵

13

                }↵

14

                else {↵

14

                else {↵

15

                    if (value <= lclip) {↵

15

                    if (value <= lclip) {↵

16

                        value = lclip;↵

16

                        value = lclip;↵

17

                    }↵

17

                    }↵

18

                }↵

18

                }↵

19

            }↵

19

            }↵

20

            else { // cases 9, 10, 11 and 12↵

20

            else { // cases 9, 10, 11 and 12↵

21

                if (value <= lclip) {↵

21

                if (value <= lclip) {↵

22

                    return; // bar is not visible↵

22

                    return; // bar is not visible↵

23

                }↵

23

                }↵

24

                base = lclip;↵

24

                base = getLowerClip();↵

25

                if (value >= uclip) {↵

25

                if (value >= uclip) {↵

26

                    value = uclip;↵

26

                   value = uclip;↵

27

                }↵

27

                }↵

28

            }

28

            }

See real code fragment |  | See real code fragment

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 16
   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) | 27.8
   Clone type | Type 2

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

   8

       if (uclip <= 0.0)

   16

       if (uclip <= 0.0)

   9

       if (value >= uclip)

   17

       if (value >= uclip)

   10

       return;

   10 | return;
   18 | return;

   Preondition Violations
   Conditional return;
   Conditional return;

   18

       return;

   11

       base = uclip;

   19

       base = uclip;

   12

       if (value <= lclip)

   20

       if (value <= lclip)

   13

       value = lclip;

   21

       value = lclip;

   14

       else if (lclip <= 0.0)

   22

       else if (lclip <= 0.0)

   15

       if (value >= uclip)

   23

       if (value >= uclip)

   16

       value = uclip;

   24

       value = uclip;

       else

       else

   17

       if (value <= lclip)

   25

       if (value <= lclip)

   18

       value = lclip;

   26

       value = lclip;

       else

       else

   19

       if (value <= lclip)

   27

       if (value <= lclip)

   20

       return;

   20 | return;
   28 | return;

   Preondition Violations
   Conditional return;
   Conditional return;

   28

       return;

   21

       base = lclip;

   21 | base = lclip;
   29 | base = getLowerClip();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   lclip | getLowerClip() | TYPE_COMPATIBLE_REPLACEMENT

   29

       base = getLowerClip();

   22

       if (value >= uclip)

   30

       if (value >= uclip)

   23

       value = uclip;

   31

       value = uclip;

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Conditional return;
   2 | Conditional return;
   3 | Conditional return;
   4 | Conditional return;
   5 | Clone fragment #1 returns variables base, value , while Clone fragment #2 returns variables base, value