1356-1-2

if (current.isClippedToWindow()) { Shape savedClip = g2.getClip(); g2.clip(this.dialFrame.getWindow(frame)); current.draw(g2, this, frame, area); g2.setClip(savedClip); } else { current.draw(g2, this, frame, area); }
if (current.isClippedToWindow()) { Shape savedClip = g2.getClip(); g2.clip(this.dialFrame.getWindow(frame)); current.draw(g2, this, frame, area); g2.setClip(savedClip); } else { current.draw(g2, this, frame, area); }

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

1

    if (current.isClippedToWindow()) {↵

1

    if (current.isClippedToWindow()) {↵

2

                        Shape savedClip = g2.getClip();↵

2

                        Shape savedClip = g2.getClip();↵

3

                        g2.clip(this.dialFrame.getWindow(frame));↵

3

                        g2.clip(this.dialFrame.getWindow(frame));↵

4

                        current.draw(g2, this, frame, area);↵

4

                        current.draw(g2, this, frame, area);↵

5

                        g2.setClip(savedClip);↵

5

                        g2.setClip(savedClip);↵

6

                    }↵

6

                    }↵

7

                    else {↵

7

                    else {↵

8

                        current.draw(g2, this, frame, area);↵

8

                        current.draw(g2, this, frame, area);↵

9

                    }

9

                    }

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

1. {Non-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) | 6.9
   Clone type | Type 2

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

   15

       if (current.isClippedToWindow())

   15 | if (current.isClippedToWindow())
   25 | if (current.isClippedToWindow())

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.dial.DialLayer | org.jfree.chart.plot.dial.DialPointer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.dial.DialLayer of variable current does not match with type org.jfree.chart.plot.dial.DialPointer of variable current
   - Make classes org.jfree.chart.plot.dial.DialLayer and org.jfree.chart.plot.dial.DialPointer extend a common superclass

   25

       if (current.isClippedToWindow())

   16

       Shape savedClip = g2.getClip();

   26

       Shape savedClip = g2.getClip();

   17

       g2.clip(this.dialFrame.getWindow(frame));

   27

       g2.clip(this.dialFrame.getWindow(frame));

   18

       current.draw(g2, this, frame, area);

   18 | current.draw(g2, this, frame, area);
   28 | current.draw(g2, this, frame, area);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.dial.DialLayer | org.jfree.chart.plot.dial.DialPointer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.dial.DialLayer of variable current does not match with type org.jfree.chart.plot.dial.DialPointer of variable current
   - Make classes org.jfree.chart.plot.dial.DialLayer and org.jfree.chart.plot.dial.DialPointer extend a common superclass

   28

       current.draw(g2, this, frame, area);

   19

       g2.setClip(savedClip);

   29

       g2.setClip(savedClip);

       else

       else

   20

       current.draw(g2, this, frame, area);

   20 | current.draw(g2, this, frame, area);
   30 | current.draw(g2, this, frame, area);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.dial.DialLayer | org.jfree.chart.plot.dial.DialPointer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.dial.DialLayer of variable current does not match with type org.jfree.chart.plot.dial.DialPointer of variable current
   - Make classes org.jfree.chart.plot.dial.DialLayer and org.jfree.chart.plot.dial.DialPointer extend a common superclass

   30

       current.draw(g2, this, frame, area);

   Precondition Violations (3)
   Row | Violation
   --- | ---
   1 | Type org.jfree.chart.plot.dial.DialLayer of variable current does not match with type org.jfree.chart.plot.dial.DialPointer of variable current
   2 | Type org.jfree.chart.plot.dial.DialLayer of variable current does not match with type org.jfree.chart.plot.dial.DialPointer of variable current
   3 | Type org.jfree.chart.plot.dial.DialLayer of variable current does not match with type org.jfree.chart.plot.dial.DialPointer of variable current