if (!stroke.equals("transparent")) { BasicStroke bStroke = new BasicStroke(stroke_width); graphics.setColor(ColorMapper.getColorByName(stroke)); graphics.setStroke(bStroke); graphics.draw(new Ellipse2D.Double(0, 0, width, height)); }
if (!stroke.equals("transparent")) { BasicStroke bStroke = new BasicStroke(stroke_width); graphics.setColor(ColorMapper.getColorByName(stroke)); graphics.setStroke(bStroke); graphics.draw(new Arc2D.Double(stroke_width, stroke_width, width, height, start, stop, type)); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/optional/image/Ellipse.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/optional/image/Arc.java
Method name: PlanarImage executeDrawOperation() Method name: PlanarImage executeDrawOperation()
Number of AST nodes: 5 Number of AST nodes: 5
1
if (!stroke.equals("transparent")) {
1
if (!stroke.equals("transparent")) {
2
            BasicStroke bStroke = new BasicStroke(stroke_width);
2
            BasicStroke bStroke = new BasicStroke(stroke_width);
3
            graphics.setColor(ColorMapper.getColorByName(stroke));
3
            graphics.setColor(ColorMapper.getColorByName(stroke));
4
            graphics.setStroke(bStroke);
4
            graphics.setStroke(bStroke);
5
            graphics.draw(new Ellipse2D.Double(0, 0, width, height
5
            graphics.draw(new Arc2D.Double(stroke_width, stroke_width, width,
6
));
6
                height, start, stop, type));
7
        }
7
        }
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (!stroke.equals("transparent"))
    3
    if (!stroke.equals("transparent"))
    4
    BasicStroke bStroke = new BasicStroke(stroke_width);
    4
    BasicStroke bStroke = new BasicStroke(stroke_width);
    5
    graphics.setColor(ColorMapper.getColorByName(stroke));
    5
    graphics.setColor(ColorMapper.getColorByName(stroke));
    6
    graphics.setStroke(bStroke);
    6
    graphics.setStroke(bStroke);
    7
    graphics.draw(new Ellipse2D.Double(0, 0, width, height));
    7
    graphics.draw(new Ellipse2D.Double(0, 0, width, height));
    7
    graphics.draw(new Arc2D.Double(stroke_width, stroke_width, width, height, start, stop, type));
    Differences
    Expression1Expression2Difference
    java.awt.geom.Ellipse2Djava.awt.geom.Arc2DSUBCLASS_TYPE_MISMATCH
    new Ellipse2D.Double(0,0,width,height)new Arc2D.Double(stroke_width,stroke_width,width,height,start,stop,type)ARGUMENT_NUMBER_MISMATCH
    7
    graphics.draw(new Arc2D.Double(stroke_width, stroke_width, width, height, start, stop, type));
    Precondition Violations (0)
    Row Violation