352-1-2

while (iterator.hasNext()) { Arc2D segment = (Arc2D) iterator.next(); if (segment != null) { Comparable key = getSectionKey(cat); paint = lookupSectionPaint(key); outlinePaint = lookupSectionOutlinePaint(key); outlineStroke = lookupSectionOutlineStroke(key); drawSide(g2, pieArea, segment, front, back, paint, outlinePaint, outlineStroke, true, false); } cat++; }
while (iterator.hasNext()) { Arc2D segment = (Arc2D) iterator.next(); if (segment != null) { Comparable key = getSectionKey(cat); paint = lookupSectionPaint(key, true); outlinePaint = lookupSectionOutlinePaint(key); outlineStroke = lookupSectionOutlineStroke(key); drawSide(g2, pieArea, segment, front, back, paint, outlinePaint, outlineStroke, false, true); } cat++; }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot3D.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot3D.java
Method name: `void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)` |  | Method name: `void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)`
Number of AST nodes: 9 |  | Number of AST nodes: 9

1

    while (iterator.hasNext()) {↵

1

    while (iterator.hasNext()) {↵

2

                Arc2D segment = (Arc2D) iterator.next();↵

2

                Arc2D segment = (Arc2D) iterator.next();↵

3

                if (segment != null) {↵

3

                if (segment != null) {↵

4

                    Comparable key = getSectionKey(cat);↵

4

                    Comparable key = getSectionKey(cat);↵

5

                    paint = lookupSectionPaint(key);↵

5

                    paint = lookupSectionPaint(key, true);↵

6

                    outlinePaint = lookupSectionOutlinePaint(key);↵

6

                    outlinePaint = lookupSectionOutlinePaint(key);↵

7

                    outlineStroke = lookupSectionOutlineStroke(key);↵

7

                    outlineStroke = lookupSectionOutlineStroke(key);↵

8

                    drawSide(g2, pieArea, segment, front, back, paint, ↵

8

                    drawSide(g2, pieArea, segment, front, back, paint, ↵

9

                            outlinePaint, outlineStroke, true, false);↵

9

                            outlinePaint, outlineStroke, false, true);↵

10

                }↵

10

                }↵

11

                cat++;↵

11

                cat++;↵

12

            }

12

            }

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) | 0.1
Clones location | Clones are in the same method
Number of node comparisons | 54

1. {Non-refactorable}

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

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

   171

       while (iterator.hasNext())

   160

       while (iterator.hasNext())

   172

       Arc2D segment = (Arc2D)iterator.next();

   161

       Arc2D segment = (Arc2D)iterator.next();

   173

       if (segment != null)

   162

       if (segment != null)

   174

       Comparable key = getSectionKey(cat);

   163

       Comparable key = getSectionKey(cat);

   175

       paint = lookupSectionPaint(key);

   175 | paint = lookupSectionPaint(key);
   164 | paint = lookupSectionPaint(key, true);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   lookupSectionPaint(key) | lookupSectionPaint(key,true) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression lookupSectionPaint(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression lookupSectionPaint(key,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   164

       paint = lookupSectionPaint(key, true);

   176

       outlinePaint = lookupSectionOutlinePaint(key);

   165

       outlinePaint = lookupSectionOutlinePaint(key);

   177

       outlineStroke = lookupSectionOutlineStroke(key);

   166

       outlineStroke = lookupSectionOutlineStroke(key);

   178

       drawSide(g2, pieArea, segment, front, back, paint, outlinePaint, outlineStroke, true, false);

   178 | drawSide(g2, pieArea, segment, front, back, paint, outlinePaint, outlineStroke, true, false);
   167 | drawSide(g2, pieArea, segment, front, back, paint, outlinePaint, outlineStroke, false, true);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   true | false | LITERAL_VALUE_MISMATCH
   false | true | LITERAL_VALUE_MISMATCH

   167

       drawSide(g2, pieArea, segment, front, back, paint, outlinePaint, outlineStroke, false, true);

   179

       cat++;

   168

       cat++;

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Expression lookupSectionPaint(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression lookupSectionPaint(key,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted