if (this.background != null && this.background.isVisible()) { if (this.background.isClippedToWindow()) { Shape savedClip = g2.getClip(); g2.clip(this.dialFrame.getWindow(frame)); this.background.draw(g2, this, frame, area); g2.setClip(savedClip); } else { this.background.draw(g2, this, frame, area); } }
if (this.cap != null && this.cap.isVisible()) { if (this.cap.isClippedToWindow()) { Shape savedClip = g2.getClip(); g2.clip(this.dialFrame.getWindow(frame)); this.cap.draw(g2, this, frame, area); g2.setClip(savedClip); } else { this.cap.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: 7 Number of AST nodes: 7
1
if (this.background != null && this.background.isVisible()) {
1
if (this.cap != null && this.cap.isVisible()) {
2
            if (this.background.isClippedToWindow()) {
2
            if (this.cap.isClippedToWindow()) {
3
                Shape savedClip = g2.getClip();
3
                Shape savedClip = g2.getClip();
4
                g2.clip(this.dialFrame.getWindow(frame));
4
                g2.clip(this.dialFrame.getWindow(frame));
5
                this.background.draw(g2, this, frame, area);
5
                this.cap.draw(g2, this, frame, area);
6
                g2.setClip(savedClip);
6
                g2.setClip(savedClip);
7
            }
7
            }
8
            else {
8
            else {
9
                this.background.draw(g2, this, frame, area);
9
                this.cap.draw(g2, this, frame, area);
10
            }
10
            }
11
        }
11
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in the same method
Number of node comparisons37
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (this.background != null && this.background.isVisible())
    4
    if (this.background != null && this.background.isVisible())
    31
    if (this.cap != null && this.cap.isVisible())
    Differences
    Expression1Expression2Difference
    backgroundcapVARIABLE_NAME_MISMATCH
    backgroundcapVARIABLE_NAME_MISMATCH
    31
    if (this.cap != null && this.cap.isVisible())
    5
    if (this.background.isClippedToWindow())
    5
    if (this.background.isClippedToWindow())
    32
    if (this.cap.isClippedToWindow())
    Differences
    Expression1Expression2Difference
    backgroundcapVARIABLE_NAME_MISMATCH
    32
    if (this.cap.isClippedToWindow())
    6
    Shape savedClip = g2.getClip();
    33
    Shape savedClip = g2.getClip();
    7
    g2.clip(this.dialFrame.getWindow(frame));
    34
    g2.clip(this.dialFrame.getWindow(frame));
    8
    this.background.draw(g2, this, frame, area);
    8
    this.background.draw(g2, this, frame, area);
    35
    this.cap.draw(g2, this, frame, area);
    Differences
    Expression1Expression2Difference
    backgroundcapVARIABLE_NAME_MISMATCH
    35
    this.cap.draw(g2, this, frame, area);
    9
    g2.setClip(savedClip);
    36
    g2.setClip(savedClip);
    else
    else
    10
    this.background.draw(g2, this, frame, area);
    10
    this.background.draw(g2, this, frame, area);
    37
    this.cap.draw(g2, this, frame, area);
    Differences
    Expression1Expression2Difference
    backgroundcapVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.background cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.cap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    37
    this.cap.draw(g2, this, frame, area);
    Precondition Violations (2)
    Row Violation
    1Expression this.background cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.cap cannot be parameterized, because it has dependencies to/from statements that will be extracted