1485-1-2

if (curr[0] == null) { series = -((Integer) prev[0]).intValue(); } else { series = ((Integer) curr[0]).intValue(); if (series < 0) { series = -((Integer) prev[0]).intValue(); } }
if (curr[0] == null) { series = -((Integer) prev[0]).intValue(); } else { series = ((Integer) curr[0]).intValue(); if (series < 0) { series = -((Integer) prev[0]).intValue(); } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StackedBarRenderer3D.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StackedBarRenderer3D.java
Method name: `void drawStackHorizontal(List, Comparable, Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset)` |  | Method name: `void drawStackVertical(List, Comparable, Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    if (curr[0] == null) {↵

1

    if (curr[0] == null) {↵

2

                    series = -((Integer) prev[0]).intValue();↵

2

                    series = -((Integer) prev[0]).intValue();↵

3

                }↵

3

                }↵

4

                else {↵

4

                else {↵

5

                    series = ((Integer) curr[0]).intValue();↵

5

                    series = ((Integer) curr[0]).intValue();↵

6

                    if (series < 0) {↵

6

                    if (series < 0) {↵

7

                        series = -((Integer) prev[0]).intValue();↵

7

                        series = -((Integer) prev[0]).intValue();↵

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

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.3
   Clone type | Type 1

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

   12

       if (curr[0] == null)

   12

       if (curr[0] == null)

   13

       series = -((Integer)prev[0]).intValue();

   13

       series = -((Integer)prev[0]).intValue();

       else

       else

   14

       series = ((Integer)curr[0]).intValue();

   14

       series = ((Integer)curr[0]).intValue();

   15

       if (series < 0)

   15

       if (series < 0)

   16

       series = -((Integer)prev[0]).intValue();

   16

       series = -((Integer)prev[0]).intValue();

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