if (orientation == PlotOrientation.HORIZONTAL) { bar = new Rectangle2D.Double(java2dValue0, rectStart, rectLength, rectBreadth); } else if (orientation == PlotOrientation.VERTICAL) { bar = new Rectangle2D.Double(rectStart, java2dValue1, rectBreadth, rectLength); }
if (orientation == PlotOrientation.HORIZONTAL) { line = new Line2D.Double(y0, x0, y1, x1); } else if (orientation == PlotOrientation.VERTICAL) { line = new Line2D.Double(x0, y0, x1, y1); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/GanttRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LineAndShapeRenderer.java
Method name: void drawTask(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, GanttCategoryDataset, int, int) Method name: void drawItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (orientation == PlotOrientation.HORIZONTAL) {
1
if (orientation == PlotOrientation.HORIZONTAL) {
2
            bar = new Rectangle2D.Double(java2dValue0, rectStart, rectLength,
2
                        line = new Line2D.Double(y0, x0, y1, x1);
3
                    rectBreadth);
3
                    }
4
        }
4
        
5
        else if (orientation == PlotOrientation.VERTICAL) {
5
            else if (orientation == PlotOrientation.VERTICAL) {
6
            bar = new Rectangle2D.Double(rectStart, java2dValue1, rectBreadth,
6
            
7
                    rectLength);
7
            line = new Line2D.Double(x0, y0, x1, y1);
8
        }
8
                    }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in different classes having the same super class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)41.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    22
    if (orientation == PlotOrientation.HORIZONTAL)
    26
    if (orientation == PlotOrientation.HORIZONTAL)
    23
    bar = new Rectangle2D.Double(java2dValue0, rectStart, rectLength, rectBreadth);
    23
    bar = new Rectangle2D.Double(java2dValue0, rectStart, rectLength, rectBreadth);
    27
    line = new Line2D.Double(y0, x0, y1, x1);
    Differences
    Expression1Expression2Difference
    barlineVARIABLE_NAME_MISMATCH
    java.awt.geom.Rectangle2Djava.awt.geom.Line2DSUBCLASS_TYPE_MISMATCH
    java.awt.geom.Rectangle2Djava.awt.geom.Line2DSUBCLASS_TYPE_MISMATCH
    java.awt.geom.Rectangle2D.Doublejava.awt.geom.Line2D.DoubleSUBCLASS_TYPE_MISMATCH
    java2dValue0y0VARIABLE_NAME_MISMATCH
    rectStartx0VARIABLE_NAME_MISMATCH
    rectLengthy1VARIABLE_NAME_MISMATCH
    rectBreadthx1VARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression new Rectangle2D.Double(java2dValue0,rectStart,rectLength,rectBreadth) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Line2D.Double(y0,x0,y1,x1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    27
    line = new Line2D.Double(y0, x0, y1, x1);
    24
    else if (orientation == PlotOrientation.VERTICAL)
    28
    else if (orientation == PlotOrientation.VERTICAL)
    25
    bar = new Rectangle2D.Double(rectStart, java2dValue1, rectBreadth, rectLength);
    25
    bar = new Rectangle2D.Double(rectStart, java2dValue1, rectBreadth, rectLength);
    29
    line = new Line2D.Double(x0, y0, x1, y1);
    Differences
    Expression1Expression2Difference
    barlineVARIABLE_NAME_MISMATCH
    java.awt.geom.Rectangle2Djava.awt.geom.Line2DSUBCLASS_TYPE_MISMATCH
    java.awt.geom.Rectangle2Djava.awt.geom.Line2DSUBCLASS_TYPE_MISMATCH
    java.awt.geom.Rectangle2D.Doublejava.awt.geom.Line2D.DoubleSUBCLASS_TYPE_MISMATCH
    rectStartx0VARIABLE_NAME_MISMATCH
    java2dValue1y0VARIABLE_NAME_MISMATCH
    rectBreadthx1VARIABLE_NAME_MISMATCH
    rectLengthy1VARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression new Rectangle2D.Double(rectStart,java2dValue1,rectBreadth,rectLength) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Line2D.Double(x0,y0,x1,y1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29
    line = new Line2D.Double(x0, y0, x1, y1);
    Precondition Violations (5)
    Row Violation
    1Expression new Rectangle2D.Double(java2dValue0,rectStart,rectLength,rectBreadth) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new Line2D.Double(y0,x0,y1,x1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new Rectangle2D.Double(rectStart,java2dValue1,rectBreadth,rectLength) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new Line2D.Double(x0,y0,x1,y1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Clone fragment #1 returns variable bar with type java.awt.geom.Rectangle2D , while Clone fragment #2 returns variable line with type java.awt.geom.Line2D